Typed slots
Design system
Components are functions, variants are enums.
Every element on this page comes from a plain Rust function that takes typed arguments and returns Markup. A variant is a Tone or a ButtonVariant — if you misspell one, the build fails instead of the styling silently disappearing.
Badges
ring-1 ring-insetEach pill is badge(label, Tone::…); the tone maps to a background, a text colour and an inset ring inside the component, so the call site never mentions a colour.
(badge("Positive", Tone::Positive))Buttons
:focus-visible outlineThree variants share one base class string and differ only in their surface, and all of them get the same keyboard-only focus ring from :focus-visible.
(button("Primary", ButtonVariant::Primary))Alerts
grid place-items-centerThe glyph well is a one-line CSS grid centring trick, and the tone enum picks both the glyph and the border/background pair.
Server-rendered
Requires a modern browser
One rule only
Cards
shadow + border tokenscard(eyebrow, title, body, footer) takes Option-wrapped slots, so the same function renders a bare card and a card with a footer without a boolean flag in sight.
Composition
Markup children
The same card, two containers
@container / container-type: inline-sizeBoth cards below are the identical component; each queries the width of its own container rather than the viewport, so the wide one goes horizontal while the narrow one stacks — at the same viewport size.
Wide container
Container query
Fraunces & Inter
A display serif for headings against a neutral grotesque for text.
Narrow container
Container query
Fraunces & Inter
A display serif for headings against a neutral grotesque for text.
@sm:flex-rowResize the window and watch the left card flip to a row while the right one stays stacked — a media query could not tell them apart.