#tailwind #dioxus #clx #ui #css

dioxus_ui

Build modular UI components in just 1 line. Tailored for the Dioxus framework.

2 releases

Uses new Rust 2024

0.1.1 Mar 15, 2025
0.1.0 Mar 3, 2025

#530 in Web programming

Download history 89/week @ 2025-02-26 39/week @ 2025-03-05 114/week @ 2025-03-12 18/week @ 2025-03-19

260 downloads per month

MIT license

14KB

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

Dependencies

~4–9.5MB
~94K SLoC