Top Navigation
TopNavigation provides a consistent header for app navigation, search, and user profile management.
Top Navigation Playground
New comment on your design
Sarah mentioned you in "Dashboard Redesign"
2 min ago
Task assigned to you
Complete the wireframes for mobile app
15 min ago
Deadline approaching
Project milestone due in 2 days
1 hour ago
Task overdue
UI review was due yesterday
3 hours ago
Design approved
Your homepage design has been approved
5 hours ago
Meeting scheduled
Team sync tomorrow at 10:00 AM
8 hours ago
Project archived
Q3 Marketing Campaign has been archived
1 day ago
Payment received
Invoice #1234 has been paid
1 day ago
Security alert
New login detected from unknown device
2 days ago
Scheduled maintenance
System maintenance on Sunday 2-4 AM
2 days ago
New team member
Alex joined the Design team
3 days ago
Export completed
Your report is ready to download
3 days ago

Overview
Installation
You can add the top navigation component to your project manually:
Install the following dependencies:
npm install class-variance-authority clsx @phosphor-icons/react @react-aria/button @react-aria/focus @react-aria/interactionsCopy and paste the following code into your project.
Update the import paths to match your project setup.
Update the import aliases (e.g. @/components, @/utils) in the copied files to match your project's path configuration.
Basic Usage
import { TopNavigation } from '@versaui/ui/components/TopNavigation';
const tabs = [
{ id: 'overview', label: 'Overview' },
{ id: 'projects', label: 'Projects' },
{ id: 'analytics', label: 'Analytics' },
];
<TopNavigation
tabs={tabs}
selectedTabId="overview"
onTabChange={(id) => setCurrentTab(id)}
/>Types
Default
Navigation with tabs and full layout:
<TopNavigation type="default" tabs={tabs} />Title
Simplified header with page title instead of tabs:
<TopNavigation type="title" pageTitle="Dashboard" />Search Types
Search Bar
Full search bar displayed in the header:
<TopNavigation searchType="bar" />Search Icon
Compact search icon button:
<TopNavigation searchType="icon" />Custom Slots
Customize left, center, and right sections:
<TopNavigation
leftSlot={<Logo />}
centerSlot={<SearchBar />}
rightSlot={<UserMenu />}
/>Notifications
Pass notification data to display a notification panel:
<TopNavigation
notifications={[
{
id: '1',
title: 'New comment',
description: 'Sarah mentioned you',
timestamp: '2 min ago',
unread: true,
leadingItem: 'icon',
},
]}
onNotificationClick={(id) => markAsRead(id)}
onMarkAllAsRead={() => markAll()}
/>Accessibility
- Uses
<header>with proper semantic structure - Navigation tabs are keyboard accessible
- Search bar supports ⌘K shortcut
- User profile menu is keyboard navigable
- Notifications panel supports Tab navigation
TopNavigation Props
| Prop | Type | Default | Description |
|---|---|---|---|
type | 'default' | 'title' | 'default' | Layout type. |
searchType | 'bar' | 'icon' | 'bar' | Search display style. |
pageTitle | string | 'Page Title' | Page title text. |
tabs | ContainerTabItem[] | — | Navigation tab items. |
selectedTabId | string | — | Active tab ID. |
onTabChange | (id: string) => void | — | Tab change handler. |
userName | string | 'Adam' | User display name. |
userEmail | string | — | User email address. |
userPerson | AvatarPerson | — | Avatar person identifier. |
notifications | NotificationData[] | [] | Notification items. |
onNotificationClick | (id: string) => void | — | Notification click handler. |
onMarkAllAsRead | () => void | — | Mark all notifications read. |
onViewAll | () => void | — | View all notifications. |
showUpgradeButton | boolean | true | Show upgrade CTA. |
onSearchClick | () => void | — | Search click handler. |
width | number | string | '100%' | Container width. |
leftSlot | ReactNode | — | Custom left content. |
centerSlot | ReactNode | — | Custom center content. |
rightSlot | ReactNode | — | Custom right content. |