datui
Color scheme

Navigation

SubnavigationBar

Horizontally scrolling row of chip-like SubnavigationButtons for filters and sub-sections.

import { SubnavigationBar, SubnavigationButton } from "datui";

Examples

selected makes a button a toggle (aria-pressed); chevron hints at a menu.

fixed gives items equal width without scrolling.

Accessibility

  • Renders a <nav>; name it with aria-label.
  • Buttons are ordinary Tab stops. With selected set, a button exposes aria-pressed; a link with selected gets aria-current="page".
  • The scroll arrows appear only for hover-capable pointers when content overflows; they are hidden from assistive tech and skipped by Tab because keyboard focus scrolls items into view.
  • With chevron, pass aria-haspopup and aria-expanded for the menu you open.

API

SubnavigationBar

Horizontally scrolling row of `SubnavigationButton`s inside a `<nav>`. Label it with `aria-label`.

PropTypeDefaultDescription
arrowSize"s" | "m"s
classNamestring—
fixedbooleanfalseEqual-width items that fit without scrolling.
noPaddingbooleanfalseRemove the side gutters.
showArrowsbooleantrueArrow buttons that scroll by a page, on hover-capable pointers when content overflows.

SubnavigationButton

Chip-like filter or section button for `SubnavigationBar`.

PropTypeDefaultDescription
afterReactNode—
appearance"accent" | "neutral""accent"Color of the selected state.
asElementType<any, keyof IntrinsicElements>—Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`.
beforeReactNode—
chevronbooleanfalseShow a down chevron (the button opens a menu; pass `aria-haspopup`/`aria-expanded`).
classNamestring—
disabledboolean—
hrefstring—
relstring—
selectedboolean—Toggle state; exposed as `aria-pressed` on buttons. Leave undefined for plain actions.
size"s" | "m" | "l""m"
targetstring—
type"button" | "submit" | "reset"—
variant"primary" | "tertiary" | "outline""primary"