Theming and density
Apply semantic color, radius, density, and shell geometry consistently across a Components subtree or AppShell.
On this page
Apply a theme
Components consume semantic variables for page, surface, text, border, navigation, brand, positive, warning, critical, and informative roles. Variants such as Primary and Positive select roles rather than palette shades.
let theme =
ComponentsTheme.emerald
|> ComponentsTheme.withRadius Radius.Large
|> ComponentsTheme.withDensity Density.Compact
|> ComponentsTheme.withControlSize ControlSize.Medium
AppShell.create "product-shell" sideNav pageContent
|> AppShell.withTheme theme
|> AppShell.render destinationUrlLight and dark modes
Built-in sky, emerald, amber, cyan, and neutral themes coordinate default, selected, hover, focus, and navigation colors in light and dark modes. Radius applies across controls and navigation. Control size is independent of navigation and shell density: use ComponentsTheme.withControlSize for an application or ControlSize.className for a region. Small, Medium and Large have 32, 40 and 48px baselines; Small uses compact 14px/20px text, and Medium is the 16px/24px default. Button, IconButton, Input and Select also support explicit withSize overrides.
Shell policy
SideNav width, mobile breakpoint, and viewport or embedded container boundary are typed application choices. PageTopBar and SideNavHeader share a semantic minimum-height token. Compact density retains the 48px shell bar and compact navigation independently of control size. Select Small explicitly for 32px controls, or retain Medium for aligned 40px actions and fields.
Product branding
Override documented semantic variables in an application theme when product branding requires it. Keep component APIs semantic rather than passing raw palette strings.