Navigation
Tabbar
Bottom navigation bar with icon destinations, labels and indicators. Usually passed to Epic's tabbar slot.
import { Tabbar, TabbarItem } from "datui";Examples
Destinations
mode="auto" stacks icon over label with three or more items.
Two items
With two items the label sits beside the icon.
Accessibility
- A
<nav>landmark (named "Main" by default, override witharia-label) containing a list of items. - Items are buttons, or links with
href; they are plain Tab stops, not a roving group. - The
selecteditem getsaria-current="page". - Items without a visible
labelneedaria-label. - Sticks to the bottom of the viewport or scroll container and pads for the device safe area.
API
Tabbar
Bottom navigation bar for `Epic`. Sticks to the bottom edge and pads for the device safe area.
| Prop | Type | Default | Description |
|---|---|---|---|
| aria-label | string | Main | Accessible name of the navigation landmark. |
| className | string | — | |
| mode | "auto" | TabbarLayout | auto | `vertical` puts icons over labels, `horizontal` beside them. `auto` is vertical with 3+ items. |
| plain | boolean | false | No top border and shadow. |
TabbarItem
One destination in `Tabbar`: icon (children), label and optional indicator. Renders a link with `href`.
| Prop | Type | Default | Description |
|---|---|---|---|
| as | ElementType<any, keyof IntrinsicElements> | — | Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`. |
| className | string | — | |
| disabled | boolean | — | |
| href | string | — | |
| indicator | ReactNode | — | Badge or counter on the icon. |
| label | ReactNode | — | Visible text. Without it, pass `aria-label`. |
| rel | string | — | |
| selected | boolean | false | Current destination: accent color and `aria-current="page"`. |
| target | string | — | |
| type | "button" | "submit" | "reset" | — |