App Header

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
titlestring—Page title text
subtitlestring—Secondary text below title
showSearchbooleantrueShow the search bar (hidden below the sm breakpoint)
showNotificationsbooleantrueShow notification bell
notificationCountnumber—Unread count: shows a dot and is announced on the bell button
user{ name: string; email?: string; avatar?: string }—Profile data. The profile dropdown only renders when set
menuItemsAppHeaderMenuItem[]—Profile dropdown items (label, icon, href, onClick, destructive) or { type: 'separator' }
onSearch(query: string) => void—Search callback
onMenuClick() => void—Mobile menu toggle. The hamburger button only renders when set

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

  • Search bar: Searchbar with Cmd+K shortcut
  • Profile dropdown: Account menu with settings
  • Mobile menu: Hamburger for mobile navigation
  • Notification badge: Visual indicator for alerts
  • Menu items: Custom profile menu with links, actions and separators

Accessibility

Accessibility considerations

ARIA Attributes

Uses header element for semantic structureSearch input has aria-labelNotification button has aria-label with countProfile menu is a Radix dropdown with 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