lumen-dioxus 6.0.0

Lumen UI components for Dioxus: web, desktop, mobile, and Dioxus Native (Blitz).
Documentation

Crate: lumen-dioxus · Dioxus: 0.7 · Rust: 1.88 or later

lumen-dioxus brings every Lumen component to Dioxus. The components render the same classes, attributes, and ARIA as @santi020k/lumen-react and share Lumen's stylesheet, so an app looks the same in a browser, in a desktop or mobile webview, and in Dioxus Native, which draws HTML and CSS with the Blitz engine instead of a webview. Interactions run in Rust, so they also work where there is no JavaScript.

On this page: Install · Quick start · Renderers · Theming · Icons · Components · Behavior and accessibility · Dioxus Native support · Versioning · Development

Install

cargo add lumen-dioxus

or in Cargo.toml:

[dependencies]
dioxus = { version = "0.7", features = ["web"] }
lumen-dioxus = "6.0"

Pick the renderer in your app's own dioxus dependency: web, desktop, mobile, or native. lumen-dioxus only depends on Dioxus's component, HTML, signal, hook, and document APIs, so it works with any of them. Optional features:

Feature Default What it adds
icon-names Yes Runtime icon names (Icon { name: "trash" }); links the full Lucide catalog
brand-icons No Font Awesome Free brand icons, as icons::brand constants and brand:<name> names

Quick start

Render LumenStyles once near the root, wrap the app in LumenTheme, and use the components from the prelude:

use dioxus::prelude::*;
use lumen_dioxus::prelude::*;

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

#[component]
fn App() -> Element {
    let mut notifications = use_signal(|| true);

    rsx! {
        LumenStyles {}
        LumenTheme {
            Card {
                CardHeader {
                    CardTitle { "Workspace plan" }
                    CardDescription { "Shared libraries and audit logs." }
                }
                CardContent {
                    label {
                        Switch {
                            checked: notifications(),
                            onchange: move |next| notifications.set(next),
                        }
                        "Notifications"
                    }
                }
                CardFooter {
                    Button { variant: ButtonVariant::Secondary, "Compare plans" }
                    Button { onclick: move |_| {}, "Upgrade" }
                }
            }
        }
    }
}

LumenStyles embeds the complete stylesheet, including the default fonts, in a <style> element. If you load styles another way, lumen_dioxus::LUMEN_CSS holds the same CSS as a string.

Every component also accepts class (appended after the Lumen classes) and any attribute its root HTML element accepts, such as id, aria_label, or r#for. Props follow the React adapter in snake case: default_value, on_value_change, and so on.

Renderers

Renderer Your dioxus features Run Notes
Web ["web"] dx serve --platform web Full support
Desktop ["desktop"] dx serve --platform desktop System webview; full support
Mobile ["mobile"] dx serve --platform ios or android System webview; full support
Dioxus Native ["native"] dx serve --platform native or cargo run Blitz engine; see Dioxus Native support
Server rendering dioxus-ssr dioxus_ssr::render_element(...) Static HTML, for sites and emails

The crate ships runnable examples that share one gallery page with every component:

cargo run --example gallery --features native-example   # Dioxus Native
cargo run --example desktop --features desktop-example  # desktop webview
dx serve --example web --features web-example --platform web
cargo run --example ssr > lumen.html                    # server rendering

For a smaller Native preview of localized numbers and nested chart themes, run from packages/dioxus with build output outside the checkout:

CARGO_TARGET_DIR=/tmp/lumen-dioxus-target cargo run --example platform_gaps --features native-example

Theming

LumenTheme sets the color scheme and appearance preset for its children, using the same data-theme, data-lumen-scheme, and data-lumen-preset attributes as every Lumen adapter, and paints the canvas background, text color, and font. Nest it to theme one section differently.

let mut scheme = use_signal(|| LumenScheme::Light);

rsx! {
    LumenStyles {}
    LumenTheme { scheme: scheme(), preset: LumenPreset::Paper,
        Button { onclick: move |_| scheme.set(scheme().toggled()), "Toggle dark mode" }
    }
}

Presets: Default, Classic (the Lumen 5 look), Paper, Luminous, Voltage, Signal, Studio (dense and quiet, for pro tools), and Aura (a violet-to-blue gradient on filled brand surfaces, brand-tinted glow elevation, and Geist type, for AI products and developer tools). Glass surfaces are opt-in per component with glass.

Aura's gradient is a plain linear-gradient layered over the solid brand color, so Dioxus Native draws it too. A renderer that can't draw the gradient shows that solid color instead.

Lumen 6 retires the Field, Clay, and KinJar presets, and LumenPreset::Studio replaces the color-only Lumen 5 Studio preset. To recreate a retired preset, generate CSS with @santi020k/lumen-core in a build step: exportLumenPaletteCss('clay', createLumenPalette(lumenPaletteStarters.clay.seeds)). The starters are starting points based on the retired themes. Load the CSS after LumenStyles and set "data-lumen-palette": "clay" on LumenTheme. For KinJar, pair the kinjar palette with LumenPreset::Luminous. For a look closer to the Lumen 5 Studio preset, pair the studio palette with LumenPreset::Default. On Dioxus Native or another CSS engine without @scope, repeat data-lumen-palette on each nested scheme or preset boundary; the direct palette rule works without scoped CSS support.

Icons

The complete Lucide catalog is available as constants in lumen_dioxus::icons::lucide. Pass a constant so only the icons you use reach the binary, or resolve a name at runtime:

rsx! {
    Icon { icon: &icons::lucide::SEARCH, label: "Search" }
    Icon { name: "trash" }
}

Unnamed icons are decorative and hidden from assistive technology. With the brand-icons feature, Icon { name: "brand:github" } resolves Font Awesome Free brand icons.

Runtime names come from the default icon-names feature, which links the whole catalog (about 360 KB) into any binary that renders an Icon. Apps that only pass constants, for example to keep a web bundle small, can drop it:

lumen-dioxus = { version = "6.0", default-features = false }

Number localization

FormattedNumber, ImageComparison value text, and MediaViewport zoom text honor BCP 47 locale values on every renderer, including Native. Examples include es-CO for Colombian currency and ar-EG-u-nu-latn for an Arabic locale with Latin digits. Numbers retain their machine-readable value while grouping, digits, currency placement, units, compact text, and screen-reader long readings use the requested locale.

Omitted, malformed, oversized, and unsupported language tags fall back to en; supported regional tags use ICU's locale fallback. Invalid numeric input or unavailable formatting data uses the component's fallback instead of mislabeling English text as localized output. currency_name: Never retains the visible reading, Always names the currency, and Auto checks the symbol actually shown in that locale. FormattedDate's optional built-in date/time formatting remains English/UTC; applications can supply localized date text as children.

The implementation uses pure-Rust ICU4X 2.4 with Rust 1.88 unchanged. Currency and compact APIs are experimental and pinned exactly (icu_experimental = 0.7.0); their types are private to Lumen. Upgrade those packages together and review the independent Intl reference fixtures before release. ICU supplies compiled locale data; generated Unicode CLDR unit patterns supplement unit categories not covered by ICU4X's formatter yet. Those patterns cover 657 locale records, deduplicated to 187 tables (about 1.8 MB of Rust source). This source size is not a measured binary or application bundle increase.

Regenerate with node scripts/generate-dioxus-unit-locales.mjs and node scripts/generate-dioxus-number-locales-fixtures.mjs from the repository root. Both accept --check to compare without writing. The unit generator downloads the SHA-512-pinned CLDR 49 archive and therefore needs network access even with --check. Both generators require exactly Node 24.21.0 with ICU 78.3 and reject other generator runtimes before reading, fetching, or writing data, including in --check mode; the application's supported runtimes are unchanged. Neither requires installing a JavaScript package. Redistributed locale data is covered by LOCALE_NOTICES.md.

Components

lumen-dioxus covers every component in the Lumen catalog. Each group links to its reference, with props, a compiled example, and renderer notes. The same examples appear as the Dioxus tab on every component page of the documentation site.

BarChart and LineChart default to matching 640 × 240 plots. Both accept width and height; RangeChart and ComboChart accept the same dimensions with 640 × 320 defaults. These coordinate frames scale responsively; pass width: 480.0 to retain the earlier bar-chart proportions. Value gutters account for compact 22px labels and custom formatter callbacks. Line and combo series support .with_dash(ChartSeriesDash::Dashed) (Solid and Dotted are also available); leave dash unset to retain automatic series patterns. Direct ChartSeries literals need the new dash: None field. Dash patterns require a CSS-capable renderer; Native Line/Combo styling retains the SVG limitations documented below.

Charts (18): Chart, Sparkline, BarChart, LineChart, PieChart, ScatterChart, Heatmap, RangeChart, ComboChart, CalendarHeatmap, FunnelChart, BoxPlot, BulletChart, LollipopChart, DumbbellChart, Histogram, WaterfallChart, ChartMotion

Content (32): Agenda, Attachment, AttachmentList, AttachmentPreview, Bubble, Code, CodeTabs, CoverImage, DeviceFrame, Eyebrow, FloatingBadge, FormattedDate, FormattedNumber, Image, ImageComparison, InstallCommand, Item, Kbd, Marker, MediaFilmstrip, MediaThumbnail, MediaViewport, Message, Note, Pill, QRCode, Schedule, SecretValue, Terminal, Testimonial, TestimonialGroup, Typography

Data components (33): Stat, StatLabel, StatValue, StatDescription, StatIcon, StatTrend, StatGroup, Meter, Rating, Timeline, Timer, Descriptions, DescriptionItem, DescriptionTerm, DescriptionDetail, Table, DataTable, Tree, TreeGrid, VirtualList, ReorderableList, ChangeSummary, FilterBar, ThemeBuilder, WorldMap, ApprovalCard, PromptComposer, SourceCitation, StreamMessage, ToolActivity, Reasoning, MessageActions, PromptSuggestions

Foundation components (23): Button, Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Badge, Alert, Progress, Spinner, Avatar, Separator, Label, Input, Textarea, Field, FieldError, Checkbox, Switch, Tabs, Icon, LumenTheme

Inputs (24): AmountField, Autocomplete, CharacterCount, CheckboxCard, CheckboxGroup, Combobox, ErrorSummary, Form, InlineEdit, InputGroup, InputOTP, ListBox, Mentions, NativeSelect, NumberField, PasswordField, RadioCard, RadioGroup, SearchField, Segmented, Select, SettingsRow, Slider, TagGroup

Layout components (24): Accordion, AspectRatio, Collapsible, Container, Direction, FeatureGrid, Hero, PageHeader, Prose, SectionHeader, Stack, Grid, Steps, Toolbar, VisuallyHidden, Watermark, Affix, ScrollArea, Resizable, GradientDivider, Carousel, KanbanBoard, KanbanColumn, MessageScroller

Motion components (16): Particles, ScrollReveal, RevealGroup, VisualEffect, Marquee, Parallax, ViewProgress, MotionGroup, TextRoll, SplitText, AnimatedNumber, Backdrop, Graphic, AnimatedLogo, AnimatedPortrait, Illustration

Navigation (31): AppHeader, BackToTop, Breadcrumb, ButtonGroup, ButtonLink, Command, ContextNavigation, CopyButton, HeadingAnchor, LanguageToggle, Link, LoadMore, Menubar, NavigationMenu, PageNav, Pagination, SelectionBar, ShareLinks, Sidebar, SidebarItem, SidebarTrigger, SiteFooter, SiteHeader, SkipLink, SpeedDial, Stepper, Anchor, SwipeCard, ThemeToggle, Toggle, ToggleGroup

Overlay components (28): Callout, Empty, ErrorState, StatusDot, Skeleton, RouteProgress, ScrollProgress, Toast, ToastViewport, Dialog, DialogHeader, DialogTitle, DialogBody, DialogFooter, DialogClose, DialogForm, AlertDialog, Sheet, Drawer, SearchDialog, SearchDialogTrigger, DropdownMenu, ContextMenu, Popover, HoverCard, Tooltip, Popconfirm, Tour

Pickers and structured editors (11): Calendar, ColorPicker, DatePicker, DateRangePicker, TimeField, FileUpload, Transfer, Cascader, TreeSelect, PhoneInput, RichTextEditor

Behavior and accessibility

  • Controlled or uncontrolled. Stateful components accept a controlled value (value, checked, open) or a default (default_value, default_checked, default_open) and report changes through on_value_change-style handlers, like the React adapter.
  • Keyboard. Tabs, menus, listboxes, grids, sliders, and trees follow the WAI-ARIA patterns: arrow keys, Home and End, typeahead where Lumen web has it, and Escape to dismiss. Keyboard paths run in Rust on every renderer.
  • Focus. On web, desktop, and mobile, roving focus moves DOM focus and dialogs and menus move focus in and back to their trigger. Dioxus Native does not report mounted elements yet, so there the roving tab stop updates but DOM focus stays where the user put it.
  • Ids. Components that link labels, descriptions, and panels generate stable ids with hooks::use_unique_id; pass your own id to control them. Generated ids come from a process-wide counter, so server rendering supports static HTML but not hydrating that HTML in the browser (Dioxus fullstack); pass explicit ids where a page must hydrate.
  • Forms. Custom controls render hidden inputs for their name and value, so native form submission keeps working.
  • Floating panels. Popovers, menus, selects, and tooltips render in the component tree with Lumen's absolute-positioning fallback. While a panel is open, a transparent DismissLayer closes it on an outside click.

Building your own components? lumen_dioxus::hooks (use_unique_id, use_controllable), lumen_dioxus::overlay (DismissLayer, is_escape, focus_element), and lumen_dioxus::time::sleep are public.

Dioxus Native support

Dioxus Native renders Lumen's HTML and CSS with Blitz, without a webview. Every component renders, and clicks, keys, and text input drive the same Rust state as on the web. Blitz 0.2, which ships with Dioxus Native 0.7, has these limits:

  • Events and focus. Blitz reports click, mouse, keyboard, and input events only: no pointer, hover, focus/blur, scroll, wheel, resize, double-click, submit, or mounted events. Hover cards can toggle on click; tooltips require a controlled open prop. Programmatic focus and focus restoration remain unavailable without mounted element handles. Drags (Resizable, Kanban, WorldMap, SwipeCard) use mouse events with approximate sizes, because elements cannot be measured; scroll-linked components (ScrollProgress, BackToTop, Anchor, Parallax, ViewProgress, MessageScroller, and VirtualList windowing) take controlled values or settle in a static state.
  • SVG. Blitz draws inline SVG as an image, so Lumen's CSS does not reach it. BarChart, PieChart, and Sparkline emit generated literal SVG paint attributes when the existing capability probe detects Native, with explicit SVG dimensions and fallback sizing for Bar. Pie keeps its canonical responsive CSS sizing. Their colors follow the nearest LumenTheme, including scheme/preset changes and nested themes; without a provider they use Default/light. The generated paints do not read custom CSS palettes, responsive rules, or animation effects. Other SVG charts and generic icons still lack inherited paint colors, and SVG marks cannot be clicked. Chart legends, data tables, and the HTML-based charts (FunnelChart, BoxPlot, BulletChart, LollipopChart, DumbbellChart) work fully.
  • Check controls. Checkbox, Switch, and the controls built on them render as <button role="checkbox"> and <button role="switch"> with aria-checked on every renderer, because Blitz ignores appearance: none on native inputs. A named, checked control renders a hidden input so forms still submit its value.
  • Web platform APIs. The clipboard, scroll observers, contenteditable, filling another element (the PromptSuggestions target), JavaScript regular expressions (the InlineEdit pattern), document keyboard shortcuts (the SearchDialog Ctrl+K and Command+K), and Rive animations have no Native equivalent. Components that need them use dioxus::document::eval on web, desktop, and mobile, and fall back to a documented state on Native: for example, CopyButton calls your on_copy handler instead, PromptSuggestions leaves the composer to your on_suggestion_select handler, InlineEdit leaves pattern unchecked, and SearchDialog opens only from its trigger.
  • Native widgets. Blitz has no <select> popup, so NativeSelect does not open there; use Select. Color and time inputs fall back to text fields, and FileUpload needs Blitz's file input support and has no drag and drop.
  • Dismissal. Blitz lays out position: fixed like absolute, so a DismissLayer covers only the nearest positioned ancestor and some outside clicks may not close a panel. Use the panel's close controls and documented keyboard paths; focus trapping, focus restoration, document-wide listeners, and top-layer positioning still depend on upstream renderer support.
  • Rendering. Placeholders do not show, text truncation clips without an ellipsis, glass (glass) needs backdrop-filter, which Blitz draws only with its Skia renderer, and tab list borders, checkbox marks, and switch thumbs need the newer Blitz on the Dioxus 0.8 line.
  • Brand gradients. Aura's gradient is a plain three-stop linear-gradient, and its glow elevation is made of box shadows; Blitz draws both. A renderer that can't draw the gradient shows the solid brand color underneath.

Each component's reference lists its renderer notes.

Versioning

lumen-dioxus shares the Lumen major with every published Lumen package and follows semantic versioning within it (shared major versions). 6.x targets Dioxus 0.7 and Lumen 6 styles; a move to a new Dioxus line waits for the next Lumen major. The minimum supported Rust version is 1.88. See the changelog.

Development

From the repository root:

pnpm run generate:dioxus-css        # rebuild assets/lumen.css from the Lumen stylesheet
pnpm run generate:dioxus-icons      # rebuild the icon constants and notices
pnpm run generate:dioxus-fixtures   # rebuild lumen-react markup fixtures (needs built packages)
pnpm run generate:dioxus-docs       # rebuild doc example tests, site data, and this component list
pnpm run check:dioxus-coverage      # every registry component has a Dioxus component

From packages/dioxus:

cargo test --features brand-icons   # unit, parity, documentation, and doc tests
cargo clippy --all-targets -- -D warnings

Inside the Lumen repository, point CARGO_TARGET_DIR outside the checkout (or run cargo clean before committing): the repository's lint hook stops at its directory scan limit when packages/dioxus/target grows large.

assets/lumen.css and the icon modules are generated; edit the canonical sources instead. The parity tests in tests/parity_*.rs render each component with Dioxus SSR and compare it with the lumen-react fixture, so both adapters keep producing the markup Lumen's CSS expects. Releases follow the release runbook.

License

MIT. The bundled fonts use the SIL Open Font License (FONT_NOTICES.md) and the icons use the ISC and CC BY 4.0 licenses (THIRD_PARTY_NOTICES.md).

Made by Santiago Molina.