Rail Nav
betaA vertical navigation list whose active marker springs between rows: a bouncing dot that squashes and stretches, or a dashed rail that hooks into the active row.
- Navigation
- 1 file
- 2 npm packages
- Accessibility notes
- Animates with motion
pnpm dlx @dowel-ui/cli add rail-navnpm packages installed: class-variance-authority, motion.
import { RailNav } from "@/components/ui/rail-nav";Default
Hook
Solid Rail
Gallery
Custom Colour
Controlled
Right To Left
<RailNav>
| Prop | Type | Default |
|---|---|---|
items (required)The rows, in order. A string or | RailNavItem[] | — |
colorAny CSS colour for the active marker. Defaults to the primary token. | string | — |
dashedDraw the hook rail as dashes. Only applies to | boolean | true |
defaultValueIndex of the row active at first, when uncontrolled. Defaults to the first selectable row. | number | — |
indicator | "bounce" | "hook" | "bounce" |
labelA title shown above the list. It also names the navigation. | ReactNode | — |
onValueChangeCalled with the index of a newly selected row. | (index: number) => void | — |
valueIndex (into | number | — |
Plus every attribute of <nav> except defaultValue, color.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes