dioxus_ui

Crates.iodioxus_ui
lib.rsdioxus_ui
version0.1.1
created_at2025-03-03 21:28:57.316907+00
updated_at2025-03-15 15:56:54.226121+00
descriptionBuild modular UI components in just 1 line. Tailored for the Dioxus framework.
homepage
repository
max_upload_size
id1576358
size53,072
Max Wells (max-wells)

documentation

README

Dioxus UI

A utility crate for creating UI components in Dioxus with Tailwind CSS class merging support. Built on tw_merge.

Features

  • clx! macro for creating components with merged Tailwind classes

Usage

Basic Component with clx!

// components/ui/card.rs
use dioxus::prelude::*;
use dioxus_ui::clx;

mod components {
    use super::*;
    clx! {Card, div, "rounded-lg p-4", "bg-sky-500"} // 🩵
}

pub use components::*;

// components/demos/demo_card.rs
#[component]
pub fn DemoCard() -> Element {
    rsx! {
        Card { "Card bg-sky-500 🩵" }
        Card { class: "bg-orange-500", "Card bg-orange-500 🧡" }
    }
}

Installation

Add this to your Cargo.toml:

[dependencies]
dioxus_ui = "0.1"

License

MIT

Commit count: 0

cargo fmt