Navigation
SubnavigationBar
Horizontally scrolling row of chip-like SubnavigationButtons for filters and sub-sections.
import { SubnavigationBar, SubnavigationButton } from "datui";Examples
Filters
selected makes a button a toggle (aria-pressed); chevron hints at a menu.
Variants and sizes
Fixed
fixed gives items equal width without scrolling.
Accessibility
- Renders a
<nav>; name it witharia-label. - Buttons are ordinary Tab stops. With
selectedset, a button exposesaria-pressed; a link withselectedgetsaria-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, passaria-haspopupandaria-expandedfor the menu you open.
API
SubnavigationBar
Horizontally scrolling row of `SubnavigationButton`s inside a `<nav>`. Label it with `aria-label`.
| Prop | Type | Default | Description |
|---|---|---|---|
| arrowSize | "s" | "m" | s | |
| className | string | — | |
| fixed | boolean | false | Equal-width items that fit without scrolling. |
| noPadding | boolean | false | Remove the side gutters. |
| showArrows | boolean | true | Arrow buttons that scroll by a page, on hover-capable pointers when content overflows. |
SubnavigationButton
Chip-like filter or section button for `SubnavigationBar`.
| Prop | Type | Default | Description |
|---|---|---|---|
| after | ReactNode | — | |
| appearance | "accent" | "neutral" | "accent" | Color of the selected state. |
| as | ElementType<any, keyof IntrinsicElements> | — | Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`. |
| before | ReactNode | — | |
| chevron | boolean | false | Show a down chevron (the button opens a menu; pass `aria-haspopup`/`aria-expanded`). |
| className | string | — | |
| disabled | boolean | — | |
| href | string | — | |
| rel | string | — | |
| selected | boolean | — | Toggle state; exposed as `aria-pressed` on buttons. Leave undefined for plain actions. |
| size | "s" | "m" | "l" | "m" | |
| target | string | — | |
| type | "button" | "submit" | "reset" | — | |
| variant | "primary" | "tertiary" | "outline" | "primary" |