App Header

Navigation
Layout

Application header with page title, search, notifications, and user profile dropdown.

Preview

A complete header component with common application features

Dashboard

Welcome back, Jens

Props

Component API reference

PropTypeDefaultDescription
titlestringPage title text
subtitlestringSecondary text below title
showSearchbooleantrueShow search button
showNotificationsbooleantrueShow notification bell
notificationCountnumberBadge count for notifications
userUserProfileUser profile data
onSearch(query: string) => voidSearch callback
onMenuClick() => voidMobile menu toggle callback

Usage

Import and implementation examples

import { AppHeader } from '@/components/ui/app-header'

// Basic usage
<AppHeader
  title="Dashboard"
  subtitle="Welcome back, Jens"
  user={{
    name: 'Jens van der Berg',
    email: 'jens@eidetic.io',
    avatar: 'J'
  }}
/>

// With search callback
<AppHeader
  title="Projects"
  onSearch={(query) => console.log('Search:', query)}
  showNotifications
  notificationCount={3}
/>

// With custom menu items
<AppHeader
  title="Settings"
  menuItems={[
    { label: 'Profile', icon: User, href: '/profile' },
    { label: 'Settings', icon: Settings, href: '/settings' },
    { type: 'separator' },
    { label: 'Sign out', icon: LogOut, onClick: handleSignOut, destructive: true },
  ]}
/>

Features

Built-in functionality

  • Expandable search: Compact button expands to input
  • Profile dropdown: Account menu with settings
  • Mobile menu: Hamburger for mobile navigation
  • Notification badge: Visual indicator for alerts
  • Keyboard shortcut: Cmd+K opens search
  • Dark mode: Full dark mode support

Accessibility

Accessibility considerations

ARIA Attributes

Uses header element for semantic structureSearch input has aria-labelNotification button has aria-label with countDropdown uses aria-expanded

Keyboard Navigation

KeyAction
Cmd+KOpen search
TabNavigate between elements
EnterActivate button/link
EscapeClose dropdown

Notes

  • Focus is managed when search opens
  • Dropdown closes on Escape
  • Mobile menu button visible on small screens