datui
Color scheme

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 with aria-label) containing a list of items.
  • Items are buttons, or links with href; they are plain Tab stops, not a roving group.
  • The selected item gets aria-current="page".
  • Items without a visible label need aria-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.

PropTypeDefaultDescription
aria-labelstringMainAccessible name of the navigation landmark.
classNamestring—
mode"auto" | TabbarLayoutauto`vertical` puts icons over labels, `horizontal` beside them. `auto` is vertical with 3+ items.
plainbooleanfalseNo top border and shadow.

TabbarItem

One destination in `Tabbar`: icon (children), label and optional indicator. Renders a link with `href`.

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>—Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`.
classNamestring—
disabledboolean—
hrefstring—
indicatorReactNode—Badge or counter on the icon.
labelReactNode—Visible text. Without it, pass `aria-label`.
relstring—
selectedbooleanfalseCurrent destination: accent color and `aria-current="page"`.
targetstring—
type"button" | "submit" | "reset"—