Gooey Nav
betaA segmented nav bar whose selected item lifts out of the group as its own tile while the rest close back into one piece, all on one spring.
- Navigation
- 1 file
- 2 npm packages
- Accessibility notes
- Animates with motion
pnpm dlx @dowel-ui/cli add gooey-navnpm packages installed: class-variance-authority, motion.
import { GooeyNav } from "@/components/ui/gooey-nav";Default
Sizes
With Icons
Links
Custom Colours
Loose
Controlled
Overflow
Right To Left
<GooeyNav>
| Prop | Type | Default |
|---|---|---|
items (required)The items. A string is a button, | GooeyNavItem[] | — |
activeClassNameClasses for the selected tile. | string | "bg-primary text-primary-foreground" |
defaultValueIndex selected at first, when uncontrolled. | number | 0 |
itemClassNameClasses for every tile, before | string | — |
onValueChangeCalled with the index of a newly selected item. | (index: number) => void | — |
radiusRadius in px of the bar's ends and of every open gap. Defaults by size: 8, 10, 12, 14. | number | — |
separationGap in px that opens on each side of the selected item. Defaults by size: 14, 16, 20, 24. | number | — |
size | "xs" | "sm" | "md" | "lg" | "md" |
valueIndex of the selected item, when controlled. | number | — |
Plus every attribute of <nav> except defaultValue.
8/8
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes