Gooey nav
A Calamansi nav whose active item pulls out of the tray on a real liquid thread, and merges back when you pick another.
Tap a tab to slide the goo
Installation
npx shadcn@latest add fujiDevv/calamansi-ui/gooey-navHow to use
import { GooeyNav } from "@/components/ui/gooey-nav"export function Demo() {return (<GooeyNavitems={[{ label: "Home", href: "/" },{ label: "Docs", href: "/components/introduction" },{ label: "Pricing", href: "/pricing" },]}/>)}
Props
Options you can pass to customize this component.
itemsoptionalGooeyNavItem[]Labels, or `{ label, href, icon }` objects. An item with an href renders as a link and takes `aria-current`, one without is a button.
valueoptionalnumberActive index, for controlled use. Leave it off and the nav keeps its own, seeded from the route when an item's href matches the current path.
defaultValueoptionalnumberActive index on mount when uncontrolled.
onChangeoptional(index: number) => voidFired with the new index on selection.
variantoptionalwhitecalamansislatecitrusPalette the active pill is painted in, and with it the drop at each of its own seams. Flat shades of the family's mid stop rather than its gradients, because the liquid has to meet the pill edge to edge.
sizeoptionalxssmmdlgLabel size, and with it the corner radius and how far the pill travels.
separationoptionalnumberOverride the gap the pill opens up on each side, in pixels.
radiusoptionalnumberOverride the brand corner radius in pixels. Defaults to the kit's share of the bar's height — about two fifths, which is the 28px corner on a 64px pill — so the turn reads the same at every size.
viscosityoptionalnumberThe SVG blur behind the fuse, in pixels, and so how far a thread reaches: the bridge survives to about 1.234 of this before it severs. Defaults to 0.55 of the gap.
thresholdoptionalnumberThe alpha ramp's slope — how hard the fused edge is, and how much the thread thins before it parts.
gooeyoptionalbooleanRun the fuse at all. Off, the surfaces simply pull apart. The filter is skipped under reduced motion either way.
beadoptionalbooleanLeave a bead behind when the thread severs — the detail that makes the move read as a liquid rather than a slide. The drop wears the material of its own seam: the palette where the pill is one of the two surfaces meeting there, the tray's own colour where neither is.
classNameoptionalstringExtra classes merged onto the nav.
Dependencies
License & Usage
- •Free to use and modify in personal and commercial projects.
- •Attribution to Calamansi UI is appreciated when using a component.
- •Please do not resell the components as your own kit.