Dioxus Bulma
A comprehensive Rust component library bringing Bulma CSS components to Dioxus applications.
Build beautiful, responsive web applications with the power of Rust and the elegance of Bulma CSS.
Features
- 🎨 Complete Bulma Integration: All Bulma CSS components implemented as Dioxus components
- ⚡ Type-Safe: Leverages Rust's type system for compile-time guarantees and better developer experience
- 🎯 Dioxus Native: Built specifically for the Dioxus ecosystem with proper event handling
- 📱 Responsive Design: Mobile-first responsive design patterns out of the box
- 🌗 Theme Support: Light/dark/auto theme modes with CSS custom properties
- 🧩 Composable Architecture: Mix and match components with consistent APIs
- 🎛️ Rich Props System: Extensive customization through typed props
- 📦 Zero Runtime Dependencies: Pure Rust implementation
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
= "0.6"
For web applications, enable the web feature:
[]
= []
= ["dioxus/web"]
= ["dioxus-bulma/router"] # Optional: Enable router integration
Router Integration
Enable router support for seamless navigation with dioxus-router:
[]
= { = "0.1.0", = ["router"] }
= "0.6"
Getting Started
1. Basic Setup
Start by wrapping your app with BulmaProvider to enable theme support and CSS loading:
use *;
use *;
2. Building Forms
Create interactive forms with validation:
3. Layout with Grid System
Use Bulma's flexible grid system:
4. Router Integration
Use components with dioxus-router for client-side navigation:
use *;
use *;
use *;
5. Advanced Components
Leverage advanced components like dropdowns and modals:
Available Components
Layout Components
Container- Responsive container with breakpoint optionsSection- Page sections with size variantsColumns/Column- Flexible grid system with responsive sizing and offsetsHero/HeroBody/HeroHead/HeroFoot- Hero banner components with sizesLevel/LevelLeft/LevelRight/LevelItem- Horizontal level layoutMedia/MediaLeft/MediaContent/MediaRight- Media object layoutTile- Metro-style tile layout system
Elements
Button- Full-featured buttons with colors, sizes, states, and variantsTitle/Subtitle- Typography components with proper heading levelsContent- Rich content container with typography stylesDelete- Delete button with size variantsIcon- Icon wrapper with size and color optionsImage- Image container with responsive sizing optionsNotification- Dismissible alert notifications with colors and light variantsProgress- Progress bars with colors and valuesTable- Data tables with styling options (bordered, striped, hoverable)Tag/Tags- Label and tag components with colors, sizes, and variants
Form Components
Input- Text inputs with validation states, icons, and various typesTextarea- Multi-line text areas with rows and validationSelect- Dropdown select inputs with multiple optionsCheckbox- Checkbox inputs with labelsRadio- Radio button inputs with groupingFile- File input components with custom stylingField- Form field wrapper with grouping and addon optionsControl- Form control wrapper with icon and loading supportLabel- Form labels with proper associationHelp- Form help text with color states
Navigation Components
Breadcrumb/BreadcrumbItem- Breadcrumb navigation with separatorsTabs/Tab- Tab navigation with styles (default, boxed, toggle)Pagination/PaginationPrevious/PaginationNext/PaginationList/PaginationLink/PaginationEllipsis- Pagination controls
Components
Card/CardHeader/CardHeaderTitle/CardContent/CardFooter/CardFooterItem- Card componentsDropdown/DropdownTrigger/DropdownMenu/DropdownItem/DropdownDivider- Dropdown menusMenu/MenuLabel/MenuList/MenuItem- Vertical navigation menusMessage/MessageHeader/MessageBody- Message components with colors and close functionalityModal/ModalCard/ModalCardHead/ModalCardBody/ModalCardFoot- Modal dialogsNavbar/NavbarBrand/NavbarMenu/NavbarItem- Navigation barsPanel/PanelHeading/PanelTabs/PanelBlock/PanelIcon- Panel components
Router-Enabled Components 🚀
When the router feature is enabled, these components support the to prop for client-side navigation:
Button- Navigate on click instead of form submissionBreadcrumbItem- Router-aware breadcrumb navigationDropdownItem- Navigate from dropdown menusMenuItem- Navigate from vertical menusPanelBlock- Navigate from panel itemsPaginationPrevious/PaginationNext/PaginationLink- Navigate between pages
Router Props:
to: Route- Navigate to route (takes priority overhref)href: String- Fallback for regular link behavior- All existing styling and event props work normally
Examples
Run the examples to see all components in action:
# Basic demo with core components
# Interactive showcase with all components
# Comprehensive demo showcasing all features
Each example demonstrates different aspects:
- demo: Basic usage patterns and core components
- showcase: Interactive components with state management
- comprehensive_demo: Complete feature set including forms, navigation, and advanced components
Component Props Reference
Core Colors and Sizes
All components support Bulma's color system:
Primary | Link | Info | Success | Warning | Danger |
White | Light | Dark | Black | Text | Ghost
Size variants available:
Small | Normal | Medium | Large
Button
Button
Input
Input
Card Structure
Card
Layout Grid
Columns
Theme System
Wrap your app with BulmaProvider to enable theming:
BulmaProvider
Development Status
This library provides a complete implementation of Bulma CSS components for Dioxus applications.
✅ Fully Implemented
- Layout Components: Container, Columns/Column, Section, Hero, Level, Media, Tile
- Elements: Button, Title/Subtitle, Content, Delete, Icon, Image, Notification, Progress, Table, Tag/Tags
- Form Components: Input, Textarea, Select, Checkbox, Radio, File, Field, Control, Label, Help
- Navigation: Breadcrumb, Tabs, Pagination with all sub-components
- Advanced Components: Card, Dropdown, Menu, Message, Modal, Navbar, Panel
- Theme System: Complete BulmaProvider with light/dark/auto themes
🎯 Features
- Type-safe props with comprehensive validation
- Consistent event handling across all components
- Responsive design patterns built-in
- Full Bulma CSS class coverage
- Zero runtime dependencies
- Comprehensive examples and documentation
🚀 Production Ready
All core Bulma components are implemented and thoroughly tested. The library is suitable for production use in Dioxus web applications.
Best Practices
Component Composition
// Prefer semantic composition
Card
// Over flat structures
div
Form Validation
// Use color props for visual validation feedback
Input
Help
Responsive Design
// Leverage Bulma's responsive system
Columns
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Development Setup
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.