dioxus_ui_system/lib.rs
1//! Dioxus UI System
2//!
3//! A pure Rust design system for Dioxus with Atomic Design principles.
4//!
5//! ## Features
6//!
7//! - **Atomic Design Architecture**: Components organized as Atoms, Molecules, and Organisms
8//! - **Type-Safe Theming**: Comprehensive theme system with light/dark/brand modes
9//! - **Pure Rust Styling**: No CSS files - all styles generated in Rust
10//! - **Tailwind-like API**: Fluent style builder for rapid UI development
11//! - **Multi-Platform**: Works on Web (WASM), Desktop, and Mobile
12//!
13//! ## Quick Start
14//!
15//! ```rust,ignore
16//! use dioxus_ui_system::prelude::*;
17//!
18//! fn App() -> Element {
19//! rsx! {
20//! ThemeProvider {
21//! Card {
22//! CardHeader { title: "Welcome" }
23//! CardContent {
24//! Button {
25//! variant: ButtonVariant::Primary,
26//! "Click me"
27//! }
28//! }
29//! }
30//! }
31//! }
32//! }
33//! ```
34
35pub mod theme;
36pub mod styles;
37pub mod atoms;
38pub mod molecules;
39pub mod organisms;
40
41/// Prelude module for convenient imports
42pub mod prelude {
43 //! Convenient re-exports for common types
44
45 // Theme
46 pub use crate::theme::{
47 ThemeTokens, ThemeMode, ColorScale, Color,
48 SpacingScale, RadiusScale, TypographyScale, Typography,
49 ThemeContext, ThemeProvider, use_theme, use_style, ThemeToggle,
50 };
51
52 // Styles
53 pub use crate::styles::Style;
54 pub use crate::{cx, style_if};
55
56 // Atoms
57 pub use crate::atoms::{
58 Button, ButtonProps, ButtonVariant, ButtonSize, ButtonType, IconButton,
59 Input, InputProps, InputType,
60 Label, LabelProps, TextSize, TextWeight, TextColor, LabelElement, Heading, HeadingLevel, MutedText,
61 Icon, IconProps, IconSize, IconColor, IconBtn as IconButton2,
62 };
63
64 // Molecules
65 pub use crate::molecules::{
66 InputGroup,
67 Card, CardProps, CardVariant, CardHeader, CardHeaderProps,
68 CardContent, CardContentProps, CardFooter, CardFooterProps, CardFooterJustify,
69 Badge, BadgeProps, BadgeVariant, BadgeSize, StatusBadge, StatusBadgeProps, StatusType,
70 };
71
72 // Organisms
73 pub use crate::organisms::{
74 Header, HeaderProps, NavItem, HeaderNavLink, MobileMenuToggle,
75 UserMenu, UserMenuProps, UserMenuItem,
76 DataTable, DataTableProps, TableColumn, ColumnAlign, Pagination, PaginationProps,
77 };
78}
79
80// Re-export at crate root for convenience
81pub use theme::*;
82pub use styles::*;