Bootstrap 5.3 components for Dioxus; primary dbcss source repository.
  • Rust 77.1%
  • JavaScript 15.7%
  • TypeScript 6.8%
  • Shell 0.4%
Find a file
mik-tf ac86e916fa
All checks were successful
CI / MSRV 1.85 (push) Successful in 2m20s
Release / Publish crates.io (push) Successful in 3m4s
CI / Check, lint, format (push) Successful in 6m2s
chore: release dbcss 0.5.5
#1

Signed-by: mik-tf <mik-tf@noreply.invalid>
2026-06-23 19:00:50 -04:00
.forgejo/workflows ci: harden Forge toolchain setup 2026-06-23 11:26:50 -04:00
.github ci: resolve dioxus cli version from metadata 2026-06-23 13:38:19 -04:00
crates/dioxus-bootstrap chore: release dbcss 0.5.5 2026-06-23 19:00:50 -04:00
docs chore: release dbcss 0.5.5 2026-06-23 19:00:50 -04:00
e2e feat: implement scrollspy parity 2026-06-23 17:53:23 -04:00
examples fix: satisfy showcase clippy for scrollspy demo 2026-06-23 18:04:54 -04:00
tools docs: finish migration parity cleanup 2026-06-23 18:32:36 -04:00
.gitignore test: add Playwright E2E tests for all showcase components 2026-03-13 12:58:50 -04:00
Cargo.toml feat: examples, migration guide — phases 5-6 2026-03-12 23:03:47 -04:00
CHANGELOG.md chore: release dbcss 0.5.5 2026-06-23 19:00:50 -04:00
LICENSE scaffold: workspace, assets, plan, and license 2026-03-12 22:54:47 -04:00
package-lock.json chore(deps-dev): bump @playwright/test from 1.58.2 to 1.61.0 (#31) 2026-06-19 00:27:45 -04:00
package.json feat(tools): add Bootstrap RSX converter 2026-06-22 23:16:40 -04:00
playwright.config.ts ci: align dioxus cli with resolved dioxus 2026-06-23 13:32:30 -04:00
README.md docs: show Forge primary CI badge 2026-06-23 14:12:28 -04:00

dioxus-bootstrap-css

Crates.io License Forge CI

GitHub mirror CI

GitHub Pages docs.rs

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

cargo add dioxus-bootstrap-css

Or pin it in Cargo.toml:

[dependencies]
dioxus = { version = "0.7", features = ["web"] }
dioxus-bootstrap-css = "0.5"
use dioxus::prelude::*;
use dioxus_bootstrap_css::prelude::*;

fn main() {
    dioxus::launch(app);
}

fn app() -> Element {
    let theme = use_signal(|| Theme::Dark);

    rsx! {
        ThemeProvider { theme }
        BootstrapHead {}
        Container { class: "py-4",
            Row { class: "g-3",
                Col { md: ColumnSize::Span(6),
                    Card {
                        header: rsx! { "Getting Started" },
                        body: rsx! {
                            p { "Bootstrap in Dioxus - fully offline, fully Rust." }
                            Button { color: Color::Primary, "Launch" }
                        },
                    }
                }
                Col { md: ColumnSize::Span(6),
                    Alert { color: Color::Success, "Everything works out of the box." }
                }
            }
        }
    }
}

Components

Layout and head:

  • BootstrapHead
  • ThemeProvider, ThemeToggle
  • Container, Row, Col

Content and data display:

  • Button, ButtonGroup, ButtonToolbar
  • Card, Alert, Badge, Icon, Spinner
  • Progress, ProgressBar, Placeholder, Figure, Ratio
  • Table, ListGroup, Pagination

Forms:

  • FormGroup, Input, Select, Textarea
  • Checkbox, Radio, Switch, Range
  • FloatingLabel, InputGroup, FormFeedback, FormText

Interactive components:

  • Modal, Dropdown, Collapse, Tabs, TabList
  • Accordion, Offcanvas, Toast, Carousel
  • Tooltip, Popover, Scrollspy
  • Navbar, NavbarToggler, NavbarCollapse, NavbarNav, Nav, Breadcrumb

Dark Mode

let theme = use_signal(|| Theme::Dark);

rsx! {
    ThemeProvider { theme }
    BootstrapHead {}
    ThemeToggle { theme }
}

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 {
    color: Color::Secondary,
    outline: true,
    size: Size::Sm,
    class: "border-0",
    "Refresh"
}

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.mjs as 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/MIGRATION.md for the complete workflow.

Tools

node tools/migrate-bootstrap-rsx.mjs path/to/app/src
node tools/migrate-bootstrap-rsx.mjs --check path/to/app/src
node tools/migrate-bootstrap-rsx.mjs --write path/to/app/src

node tools/check-no-raw-bootstrap.mjs path/to/app/src
npm run lint:bootstrap

tools/README.md documents the converter and migration gate.

Examples

  • examples/showcase demonstrates the component set.
  • examples/dashboard is a compact admin dashboard example.

Changelog

See CHANGELOG.md.

Release

See docs/RELEASE.md.

Governance

See docs/GOVERNANCE.md.

License

Apache-2.0.