Resizable Navbar
Full-width navbar that shrinks into a floating, blurred pill once you scroll.
- 2.6 KB gzipped
- Deps: motion/react
- Reduced-motion safe
- Base UI & Radix compatible
Scroll inside this box — the bar shrinks into a floating pill.
Installation
pnpm dlx shadcn@latest add https://velora.colorlib.com/r/resizable-navbar.jsonAdds components/velora/resizable-navbar.tsx, installs motion.
Examples
Landing page shell
A full landing page in a scroll box: hero, logos, features and a closing CTA.
New — timelines are here
Plan the work. Skip the meetings.
One calm place for roadmaps, requests and releases — built for teams of five to five hundred.
- Northwind
- Umbra
- Keystone
- Halcyon
- Brightline
Instant sync
Edits reach every device in under 100ms.
Nested views
Boards, lists and timelines over the same data.
Private by default
End-to-end encryption on every plan.
Smart triage
Sort incoming requests before you open them.
Free for teams under ten
No card required. Upgrade when you outgrow it.
Props
| Prop | Type | Default |
|---|---|---|
items*Links shown in the bar (and in the mobile menu) | NavItem[] | — |
logoBrand mark or logo link on the left | React.ReactNode | — |
ctaCall to action on the right (e.g. a sign-up link) | React.ReactNode | — |
thresholdPixels scrolled before the bar shrinks into a floating pill | number | 80 |
compactWidthMaximum width of the floating pill, in px | number | 760 |
maxWidthMaximum width of the full bar, in px | number | 1152 |
activeHrefhref of the current page; that link gets aria-current="page" | string | — |
labelAccessible name of the navigation landmark | string | "Main" |
containerScrollable element to watch instead of the window | React.RefObject<HTMLElement | null> | — |
Also accepts every React.HTMLAttributes<HTMLElement> prop, forwarded to the root element.
NavItem
interface NavItem {
label: string;
href: string;
}Accessibility
- Reduced motion
- The bar still narrows into the pill past the threshold, but it snaps to size instead of springing; the link highlight jumps rather than glides and the mobile menu appears without sliding.
- Keyboard
- Links are native anchors and the highlight follows keyboard focus. In the narrow layout a Menu button toggles the link list; Escape closes it and returns focus to the button, and choosing a link or clicking outside closes it too.
- Screen readers
- A header containing a nav landmark (label prop) with aria-current on the active link; the menu button reports aria-expanded and aria-controls, and the highlight is aria-hidden.