Join our Discord community
Navbar

Search and Toggle Navigation Bar

Feature-rich navigation bar with search functionality, test mode toggle, layout controls, and comprehensive menu system. Includes notifications, settings, info menu, and quick action buttons for productivity applications.

Powered by

Loading component...

Installation

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

Features

  • Search functionality with icon-decorated input field for content discovery
  • Test mode toggle with labeled switch for development and production environments
  • Layout grid button for accessing layout and view options
  • Information menu with help, documentation, tutorials, and feedback options
  • Notification system with unread count badge and detailed notification dropdown
  • Settings menu with comprehensive configuration options and API management
  • Quick add button with prominent rounded design for primary actions
  • Responsive design with test mode hidden on mobile devices
  • TypeScript support with comprehensive interface definitions and state management

Use Cases

This free open source React component works well for:

  • Admin dashboards - Management interfaces with search, settings, and notifications using Next.js
  • Development tools - Applications with test/production mode switching using TypeScript
  • Content management - Platforms with search functionality and comprehensive menus using Tailwind CSS
  • Productivity applications - Tools with layout controls, notifications, and quick actions

API Reference

PropTypeDefaultDescription
searchPlaceholderstring"Search..."Placeholder text for the search input
searchValuestringundefinedControlled search input value
testModebooleanundefinedControlled test mode state
showTestModebooleantrueWhether to show the test mode toggle
notificationsNotification[]defaultNotificationsArray of notification objects
onSearchChange(value: string) => voidundefinedCallback for search input changes
onTestModeChange(enabled: boolean) => voidundefinedCallback for test mode toggle
onLayoutClick() => voidundefinedCallback for layout button clicks
onAddClick() => voidundefinedCallback for add button clicks
onInfoItemClick(item: string) => voidundefinedCallback for info menu item clicks
onNotificationClick(notificationId: string) => voidundefinedCallback for notification clicks
onSettingsItemClick(item: string) => voidundefinedCallback for settings menu item clicks

Search Features

  • Icon Integration - Search icon positioned inside input field for clear visual hierarchy
  • Responsive Width - Search input with max-width constraint for optimal layout
  • Controlled State - Support for both controlled and uncontrolled search value
  • Accessible Labels - Proper labeling and placeholder text for screen readers

Test Mode Toggle

  • Labeled Switch - Clear "Test mode" label with compact switch component
  • State Management - Support for controlled and uncontrolled toggle state
  • Mobile Hidden - Test mode toggle hidden on mobile devices to save space
  • Callback Support - Change handler for integration with application state
  • Info Menu - Help, documentation, tutorials, feedback, and about options
  • Notification Menu - Rich notification display with unread indicators and timestamps
  • Settings Menu - Preferences, appearance, privacy, integrations, API keys, and billing
  • Consistent Styling - All menus use rounded-full buttons with muted foreground colors

Implementation Notes

  • Uses shadcn/ui Input component with absolute positioned search icon
  • Test mode switch supports both controlled and uncontrolled usage patterns
  • All menu components are modular and can be used independently
  • Notification system includes visual unread indicators with destructive badge variant
  • Search input includes proper peer styling for icon positioning
  • Compatible with shadcn/ui design system and Tailwind CSS styling framework
  • Layout button provides access to view and layout configuration options
  • Add button uses prominent rounded design to emphasize primary action functionality