NavBar
layoutsA horizontal nav landmark of links or in-page tabs with count badges, a centre notch for a raised action, and flush, floating or bottom-bar placements.
Podcast app bottom navigation
Button items make a tablist driven by bind:value; variant="floating" insets the bar and center holds a raised record button.
Library
Night Drive · KaleidoPaper Boats · June HollowStatic Bloom · KaleidoLantern · Oro ValleyHalfway Home · June HollowOrientation and chrome
orientation="stacked" | "inline"; variant="flush" | "floating"; maxWidth caps and centres the row.
Links, badges and long labels
href items render links with aria-current="page" from current; badges take numbers or text and hide at 0; emoji replaces icon; long stacked labels shrink, then wrap to two lines, then ellipsis.
Many items on a phone
labels="fit" (default) shrinks stacked labels to one size, down to 10px, then wraps and only then truncates; "truncate" keeps one full-size line; "full" never clips and lets labels spill.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
items required | NavBarItem[] | — | |
label required | string | — | Accessible name of the `<nav>` landmark. |
value bindable | string | — | `value` of the current item, for in-page views without routes. |
onchange | (value: string) => void | — | |
center | Snippet | — | Fills a notch in the middle of the row (`centerWidth`), may rise above it (`centerRaise`). |
placement | 'bar' | 'inline' | 'inline' | 'bar' = fixed to the bottom edge with safe-area padding. |
orientation | 'stacked' | 'inline' | 'stacked' | Icon over label vs icon beside label. |
variant | 'flush' | 'floating' | 'flush' | 'floating' = rounded elevated card inset from the edges. |
labels | 'fit' | 'truncate' | 'full' | 'fit' | Stacked labels that run out of room. 'fit' shrinks the font down to 10px so the longest word fits, then wraps to two lines, then ellipsis. 'truncate' = one line with ellipsis at full size. 'full' never clips: labels spill past their item. |
maxWidth | string | — | Caps and centres the row of items. |
centerWidth | string | '4.5rem' | Width of the `center` notch (any CSS length). |
centerRaise | string | — | How far `center` rises above the row (any CSS length). |
class | string | '' | |
style | string | '' |