dioxus-bootstrap-css
Bootstrap 5.3 components for Dioxus. The crate uses real Bootstrap CSS and Bootstrap Icons, bundles assets for offline-first apps, and replaces Bootstrap JavaScript behavior with Dioxus signals.
Live showcase: https://mik-tf.github.io/dioxus-bootstrap-css/
API docs: https://docs.rs/dioxus-bootstrap-css
Primary repository: https://forge.ourworld.tf/lhumina_code/dioxus-bootstrap-css
GitHub mirror: https://github.com/mik-tf/dioxus-bootstrap-css
Short name: dbcss means dioxus-bootstrap-css. The full crate name is long,
so issues and notes may use the abbreviation.
Design rule: if Bootstrap does it, this crate should expose a typed Dioxus way to express it. If Bootstrap does not do it, this crate should not invent it.
Why
- Pixel fidelity by using Bootstrap 5.3 CSS instead of a reimplementation.
- Zero Bootstrap JavaScript; interactions are driven by Dioxus state.
- Offline-first CSS and icon assets through
BootstrapHead. - Type-safe component props for color, size, state, slots, and variants.
- Migration tools for converting raw Bootstrap RSX into typed components.
Quick Start
Or pin it in Cargo.toml:
[]
= { = "0.7", = ["web"] }
= "0.5"
use *;
use *;
Components
Layout and head:
BootstrapHeadThemeProvider,ThemeToggleContainer,Row,Col
Content and data display:
Button,ButtonGroup,ButtonToolbarCard,Alert,Badge,Icon,SpinnerProgress,ProgressBar,Placeholder,Figure,RatioTable,ListGroup,Pagination
Forms:
FormGroup,Input,Select,TextareaCheckbox,Radio,Switch,RangeFloatingLabel,InputGroup,FormFeedback,FormText
Interactive components:
Modal,Dropdown,Collapse,Tabs,TabListAccordion,Offcanvas,Toast,CarouselTooltip,Popover,ScrollspyNavbar,NavbarToggler,NavbarCollapse,NavbarNav,Nav,Breadcrumb
Dark Mode
let theme = use_signal;
rsx!
ThemeProvider sets data-bs-theme on the document and lets Bootstrap handle
the rest.
Migration From Bootstrap HTML
Convert Bootstrap HTML or raw Bootstrap RSX by replacing component classes with typed components:
Button
Key principles:
- Use Bootstrap utility classes (
small,py-2,mb-0) for layout and spacing. - Use component props (
color,outline,size,header_class,responsive) for component intent. - Replace Bootstrap JavaScript with Dioxus signals.
- Treat
tools/check-no-raw-bootstrap.mjsas a completeness gate, not a visual-fidelity proof. - Let the converter map Bootstrap intent to props, flag unsafe cases instead of guessing, then prove fidelity with Playwright screenshots.
See docs/04_migration.md for the complete workflow.
Tools
tools/README.md documents the converter and migration gate.
Examples
examples/showcasedemonstrates the component set.examples/dashboardis a compact admin dashboard example.
Changelog
See CHANGELOG.md.
Release
See docs/08_release.md.
Governance
License
Apache-2.0.