Navbar

A horizontal navigation bar with multiple styling variants for organizing links and actions. Supports icons, dropdown menus, and consistent visual hierarchy across your application.

Component Setup

Create or update your Navbar component

Copy this code to create your Navbar component

/components/ui/Navbar.tsx
Loading syntax highlighting...

Test Your Component

  • 1. Add the component to a test page
  • 2. Check all props and variants work as expected
  • 3. Verify responsive behavior
  • 4. Test with different content/data
  • 5. Ensure accessibility features work correctly

Stroke Variant

Navbar items with border outlines for better visual separation.

Ghost Variant

Minimal styling with hover effects for secondary navigation.

Advanced Examples

Complete navbar examples with logos, icons, and dropdown menus.

API Reference

The Navbar component is a compound component that consists of several parts. Each part has its own set of props that can be used to customize its appearance and behavior.

The container component that provides the main navbar structure.

PropTypeDefaultDescription
className"string""undefined"

Additional CSS classes to apply to the navbar root.

children"ReactNode""undefined"

The content of the navbar.

A container for navbar items, typically used to group navigation links.

PropTypeDefaultDescription
className"string""undefined"

Additional CSS classes to apply to the navbar menu.

children"ReactNode""undefined"

The content of the navbar menu, typically Navbar.Item components.

Individual navigation item that can be styled in different variants and can contain icons.

PropTypeDefaultDescription
variant
"default""stroke""ghost"
"default"

The visual style variant of the navbar item.

active"boolean""false"

When true, applies active styling to the navbar item.

asChild"boolean""false"

When true, the component will render its child directly, transferring all props to it.

href"string""undefined"

The URL that the navbar item links to.

className"string""undefined"

Additional CSS classes to apply to the navbar item.

children"ReactNode""undefined"

The content of the navbar item.

Icon component that can be used within a navbar item.

PropTypeDefaultDescription
as"ReactElement""undefined"

The icon component to render.

className"string""undefined"

Additional CSS classes to apply to the icon.