TabBar
layoutsA phone bottom tab bar fixed to the safe-area edge that publishes --tabbar-h, as a tablist with roving focus or a nav of links.
Chat app tabs
placement="inline" so it sits in this phone frame (the default "bar" fixes it to the viewport bottom); each tab controls its panel.
Badges and item counts
Numeric badges cap at 99+ and hide at 0; text badges render verbatim; three to five items share the width.
Links, long labels and silent taps
href items make a nav with aria-current="page"; long labels truncate; sound={false} silences one bar; onselect reports the new id.
Bottom bar and toasts
the default placement="bar" fixes the bar to the viewport bottom and publishes --tabbar-h (a CSS default holds it from the first frame); the Toaster stacks above it with no setup. The example moves the bar to <body> because the showcase cards are query containers, which re-anchor position: fixed.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
items required | TabBarItem[] | — | |
value bindable | string | — | `id` of the selected item. |
onselect | (id: string, item: TabBarItem) => void | — | |
label | string | 'Primary' | Accessible name of the bar. |
placement | 'bar' | 'inline' | 'bar' | 'bar' = fixed to the bottom edge; 'inline' = flows with its parent. |
sound | boolean | true | Play UI sounds when enabled globally; false silences this instance. |
class | string | '' |