115 Components
Navbar
NavigationKinetic responsive navigation bar with scroll-direction sensing, shared-layout spring indicators, multi-level dropdowns, and an animated mobile drawer.
NewShared LayoutResponsiveA11y Ready
Installation
Install directly into your project using the shadcn CLI or copy the source code manually.
Requires:framer-motionlucide-reactclsxtailwind-merge
$npx shadcn@latest add "https://boseui.site/r/navbar.json"
Props
TypeScript props supported by <Navbar />.
| Prop | Type | Default | Description |
|---|---|---|---|
| brand | React.ReactNode | — | Custom brand slot (logo and product name). |
| items | NavbarItem[] | DEFAULT_ITEMS | Array of navigation items, sub-menus, icons, and badge tags. |
| actions | NavbarAction[] | DEFAULT_ACTIONS | Right-aligned call-to-action buttons with primary or ghost variants. |
| variant | "floating" | "fixed" | "glass" | "floating" | Visual presentation mode for the navbar container. |
| hideOnScroll | boolean | true | Whether to hide the navbar during downward scrolling. |
| activeHref | string | "#features" | Active link href identifier for styling and aria-current. |
| onNavigate | (href: string) => void | — | Callback fired when a user selects a navigation target. |
Key Features
- Smart scroll sensing: automatically collapses or hides on downward scroll and glides back on upward scroll.
- Dual layoutId spring indicators: smooth hover capsule and active link indicator.
- Multi-level animated dropdown sub-menus with spring scale and staggered disclosure.
- Integrated mobile navigation drawer with animated hamburger toggle and backdrop blur.
- Multiple layout variants: floating island, fixed header, or frosted glass.
- Respects prefers-reduced-motion with instant fallback transitions.
Keyboard & Accessibility
- Semantic <header> and <nav aria-label='Main Navigation'> landmark markup.
- Full keyboard navigation with Escape key dismissal of open dropdowns and mobile menus.
- Supports aria-expanded, aria-haspopup, and aria-current='page' attributes.
- High-contrast focus-visible rings for keyboard-only navigation.