DS0
Patterns

Navbar

A responsive top navigation bar with logo, nav links, user menu, and mobile drawer.

Overview

The Navbar recipe provides a responsive top navigation bar with a logo, horizontal links, action buttons, and an optional user avatar menu with logout. On mobile, links collapse into a hamburger drawer.

Usage

import { Navbar } from '@/recipes/navbar';

<Navbar
  logo={<span className="font-bold">MyApp</span>}
  links={[
    { label: 'Home', href: '/', isActive: true },
    { label: 'Products', href: '/products' },
    { label: 'About', href: '/about' },
  ]}
  user={{ name: 'John Doe', email: 'john@example.com', avatarUrl: '/avatar.jpg' }}
  onLogout={() => signOut()}
  sticky
/>

API Reference

PropTypeDefaultDescription
logoReactNodeLogo element
linksArray<{ label: string; href: string; isActive?: boolean }>Nav links
actionsReactNodeAction buttons (CTA, search)
user{ name: string; email: string; avatarUrl?: string }User info for avatar menu
onLogout() => voidLogout handler
stickybooleanfalseSticky positioning
classNamestringAdditional CSS classes

On this page