115 Components

Navbar

Navigation

Kinetic responsive navigation bar with scroll-direction sensing, shared-layout spring indicators, multi-level dropdowns, and an animated mobile drawer.

NewShared LayoutResponsiveA11y Ready
/r/navbar.json

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 />.

7 props
PropTypeDefaultDescription
brandReact.ReactNode—Custom brand slot (logo and product name).
itemsNavbarItem[]DEFAULT_ITEMSArray of navigation items, sub-menus, icons, and badge tags.
actionsNavbarAction[]DEFAULT_ACTIONSRight-aligned call-to-action buttons with primary or ghost variants.
variant"floating" | "fixed" | "glass""floating"Visual presentation mode for the navbar container.
hideOnScrollbooleantrueWhether to hide the navbar during downward scrolling.
activeHrefstring"#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.