Dioxus Components Library
A comprehensive collection of reusable Dioxus 0.7 components built with Tailwind CSS v4 and following Radix UI design patterns.
Features
✨ 6 High-Quality Components
- 🎯 Accordion - Collapsible sections with single/multiple modes
- 👤 Avatar - User avatars with image loading and fallback support
- 🏷️ Badge - Flexible badges with 4 style variants
- 🔘 Button - Versatile buttons with 6 variants and 6 sizes
- ⏳ Spinner - Loading indicators with multiple sizes and colors
- 💬 Tooltip - Hover-triggered tooltips with flexible positioning
🎨 Styling
- Built with Tailwind CSS v4 for consistent, utility-first styling
- Dark mode support on all components
- Customizable through Tailwind theme configuration
- Responsive design patterns built-in
♿ Accessibility
- WAI-ARIA compliant
- Keyboard navigation support
- Screen reader friendly
- Focus management
Installation
Add to your Cargo.toml:
[]
= { = "./dioxus_components" }
= { = "0.7.1", = ["web"] }
Quick Start
Basic Component Usage
use *;
use ;
Components Included
- Accordion - Collapsible sections with single/multiple modes
- Avatar - User avatars with image loading and fallback
- Badge - Small decorative labels with 4 variants
- Button - Versatile buttons with 6 variants and 6 sizes
- Spinner - Loading indicators with multiple sizes
- Tooltip - Hover-triggered tooltips with positioning
See COMPONENTS.md for detailed documentation and API references for all components.
Running the Demo
Build the library:
Run the demo application:
Project Structure
src/
├── lib.rs # Library entry point
├── components/ # All reusable components
│ ├── accordion/
│ ├── avatar/
│ ├── badge/
│ ├── button/
│ ├── spinner/
│ └── tooltip/
└── utils/ # Utility functions
examples/
└── demo.rs # Demo application
COMPONENTS.md # Full component documentation
Building as a Library
This project is configured as a Rust library that can be:
- Used as a dependency in other Dioxus projects
- Published to crates.io
- Used locally via path dependencies
Library Exports
The library exports all components and utilities:
pub use ;
Customization
Theme Colors
Update colors in your tailwind.css:
@}
Custom Styling
All components support the class prop:
Button
Development
Build the library:
Run tests:
Generate documentation:
License
MIT
Resources
- Run the following command in the root of the project to start the Tailwind CSS compiler:
Serving Your App
Run the following command in the root of your project to start developing with the default platform:
To run for a different platform, use the --platform platform flag. E.g.