Join our Discord community
Navbar

Two-Tier Navigation Bar

Two-tier navigation bar with centered search functionality and bottom navigation menu. Features prominent search with keyboard shortcuts, notification system, and user profile management for content-focused applications.

Powered by

Loading component...

Installation

npx shadcn@latest add https://www.shadcn.io/registry/navbar-08.json
npx shadcn@latest add https://www.shadcn.io/registry/navbar-08.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/navbar-08.json
bunx shadcn@latest add https://www.shadcn.io/registry/navbar-08.json

Features

  • Two-tier layout with top utility bar and bottom navigation menu for clear content hierarchy
  • Centered search functionality with prominent placement and keyboard shortcut indicator
  • Keyboard shortcut display showing customizable shortcuts like ⌘K for enhanced user experience
  • Bottom navigation tier with main navigation links hidden on mobile for space efficiency
  • Notification system with badge counter and dropdown message list
  • User profile menu with avatar display and account management options
  • Container-based responsive design with automatic mobile/desktop switching based on actual width
  • TypeScript support with comprehensive interface definitions and callback functions
  • shadcn/ui integration using Input, Badge, and DropdownMenu components

Use Cases

This free open source React component works well for:

  • Content platforms - Blogs, documentation sites, and media applications built with Next.js
  • Search-focused applications - Platforms where search is a primary user action using TypeScript
  • Knowledge bases - Documentation and help center sites requiring prominent search using Tailwind CSS
  • Media applications - Content discovery platforms with search-first navigation

API Reference

PropTypeDefaultDescription
logoReact.ReactNode<Logo />Logo component to display in the navbar
logoHrefstring"#"URL for logo click navigation
navigationLinksNavbar08NavItem[]defaultNavigationLinksArray of navigation menu items for bottom tier
searchPlaceholderstring"Search..."Placeholder text for the search input field
searchShortcutstring"⌘K"Keyboard shortcut text displayed in search field
userNamestring"John Doe"Display name for the user profile
userEmailstring"[email protected]"Email address for the user profile
userAvatarstringundefinedURL for user avatar image
notificationCountnumber3Number of unread notifications to display
onNavItemClick(href: string) => voidundefinedCallback for navigation item clicks
onSearchSubmit(query: string) => voidundefinedCallback for search form submissions
onNotificationItemClick(item: string) => voidundefinedCallback for notification item clicks
onUserItemClick(item: string) => voidundefinedCallback for user menu item clicks

Two-Tier Layout Features

  • Top Tier - Logo, centered search, and user utilities in a clean horizontal layout
  • Bottom Tier - Main navigation menu with border separation from top section
  • Mobile Optimization - Bottom navigation collapses to hamburger menu on mobile devices
  • Search Prominence - Central positioning emphasizes search functionality for content discovery

Search Integration

  • Centered Search Bar - Prominent placement with search icon and keyboard shortcut
  • Form Handling - Proper form submission with preventDefault for demonstration
  • Keyboard Shortcuts - Visual indicator for keyboard shortcuts like ⌘K or Ctrl+K
  • Responsive Design - Search maintains central position across different screen sizes

Implementation Notes

  • Uses ResizeObserver for container-based responsive behavior independent of viewport
  • Supports keyboard navigation and accessibility standards through Radix UI components
  • Mobile menu automatically appears when container width is less than 768px
  • Bottom navigation tier automatically hides on mobile to maximize screen space
  • Search form includes proper form handling with preventDefault for demonstration
  • All navigation items are non-functional for demonstration purposes with callback support
  • Compatible with shadcn/ui design system and Tailwind CSS styling framework
  • Two-tier layout provides clear visual hierarchy between utilities and navigation