Dioxus Element Plus
English | 简体中文
Element Plus UI components for Dioxus 0.7 with pure Rust styling — zero runtime overhead.
Repository: pauljohn21/dioxus-element-plug
Features
- 🎨 Pure Rust styling — Compile-time CSS generation, zero runtime overhead
- 🦀 Rust-native components — Type-safe components built for Dioxus 0.7
- 📦 107+ components — Complete Element Plus component library
- 🎯 Controlled component pattern — Parent owns state, communicates via
EventHandler - 📱 Responsive design — 24-column grid system
- ⚡ Zero SCSS dependencies — No runtime CSS compilation
Quick Start
1. Add dependency
[]
= { = "0.7", = ["web"] }
= "0.2.0"
Or from GitHub:
= { = "https://github.com/pauljohn21/dioxus-element-plug.git" }
2. Generate styles
Option A: Pure Rust CSS generation (recommended)
use *;
use *;
Tree-shaking — generate only what you need:
let styles = new
.generate_styles_for_components;
Option B: CDN (quick prototyping)
rsx!
3. Use components
use *;
use *;
Available Components
Layout
| Component | Description |
|---|---|
Container Header Main Footer Aside |
Page layout structure |
Row / Col |
24-column responsive grid system |
Space |
Flexible spacing component |
Form
| Component | Key Props | Events |
|---|---|---|
Button |
variant: ButtonVariant, size: Option<ButtonSize>, disabled |
on_click: EventHandler<MouseEvent> |
Input |
value: Option<String>, input_type: InputType, size: InputSize |
on_change: EventHandler<Event<FormData>> |
Select |
model_value: Option<String>, options: Vec<SelectOption>, placeholder: String |
on_change: EventHandler<String> |
Switch |
model_value: bool, size: SwitchSize |
on_change: EventHandler<bool> |
Checkbox |
model_value: bool, border: bool |
on_change: EventHandler<bool> |
Radio |
model_value: bool, border: bool |
on_change: EventHandler<bool> |
Rate |
model_value: u32, max: u32 |
on_change: EventHandler<u32> |
Slider |
model_value: u32, min: u32, max: u32 |
on_change: EventHandler<u32> |
InputNumber |
model_value: i64, min: i64, max: i64 |
on_change: EventHandler<i64> |
Form / FormItem |
label, required |
— |
Data Display
| Component | Description |
|---|---|
Table |
Sortable, filterable data table with TableColumn |
Tree |
Hierarchical tree with TreeNodeData, checkbox support |
Card |
Content container with header and shadow |
Tag |
Closable tags with TagType, TagSize, TagEffect |
Progress |
Line, circle, dashboard progress bars |
Badge |
Notification badges, dot mode |
Avatar |
User avatars |
Collapse / CollapseItem |
Collapsible panels |
Descriptions |
Structured data display |
Navigation
| Component | Description |
|---|---|
Menu / MenuItem / SubMenu |
Horizontal / vertical navigation menu |
Tabs |
Tabbed content |
Breadcrumb / BreadcrumbItem |
Breadcrumb navigation |
Pagination |
Pagination control |
Steps / Step |
Step progress indicator |
Feedback
| Component | Description |
|---|---|
Dialog |
Modal dialog (controlled via visible prop) |
Drawer |
Slide-out panel |
Alert |
Alert messages |
Message |
Toast messages |
Notification |
Notifications |
Tooltip / Popover / Popconfirm |
Floating overlays |
Component Examples
Buttons
use *;
rsx!
Controlled Component (Switch)
All interactive components follow the controlled pattern — parent owns state via use_signal, passes it through props, and receives changes via EventHandler callbacks:
use *;
use *;
Table
use HashMap;
use *;
use ;
rsx!
Grid Layout
use *;
rsx!
Theme Customization
use ;
let custom_theme = new
.with_primary_color
.with_font_size;
let styles = new
.with_theme
.generate_complete_styles;
Project Status
Production Ready — 107+ components with pure Rust styling.
- ✅ 107+ components via
#[component]macro - ✅ 96 component files in
src/components/ - ✅ Full Element Plus design system compatibility
- ✅ Pure Rust CSS generation (zero runtime overhead)
- ✅ Controlled component pattern throughout
- ✅ Dioxus 0.7 integration, zero compilation errors
Project Structure
dioxus-element-plug/
├── src/
│ ├── components/ # 107+ Element Plus style components (96 files)
│ ├── styles/ # Modular CSS constants (colors, spacing, shadows, etc.)
│ ├── style_system.rs # Pure Rust CSS generation (Theme, CompleteStyleManager)
│ └── lib.rs # Crate entry point + prelude module
├── examples/
│ ├── component-showcase/ # Component verification (13 categories)
│ └── theme-switcher/ # Theme switching demo (5 themes)
├── Cargo.toml
├── AGENTS.md # AI agent guidance
├── SKILL.md # Skill documentation
├── README.md # English (this file)
└── README.zh-CN.md # 简体中文
Commands
&& &&
Examples
- component-showcase — 13 component categories (Button, Input, Select, Switch, Alert, Tag, Card, Dialog, Table, Tree, Cascader, Transfer, Progress)
- theme-switcher — 5 themes (Default, Dark, Green, Purple, Orange)
License
MIT License — see LICENSE file for details.
Credits
- Element Plus — Modern design system and component library
- Dioxus — Modern React-like framework for Rust
Star & Support
If you find this project helpful, please consider: