Skip to main content

Header

Sticky top navigation bar with title, breadcrumbs, and right-side action slots.

Preview ยท Header

Codeโ€‹

<div style="display:flex;align-items:center;gap:1rem;padding:0.75rem 1.25rem;background:var(--card);border:1px solid var(--border);border-radius:var(--radius-medium);width:100%">
<strong style="font-size:0.9rem">Primus Admin</strong>
<span style="font-size:0.75rem;color:var(--muted-foreground)">/ Tenants</span>
<div style="margin-inline-start:auto;display:flex;gap:0.5rem;align-items:center">
<button class="ghost small">Help</button>
<button class="icon small" title="Notifications">๐Ÿ””</button>
<button class="outline small">Jane Doe โ–พ</button>
</div>
</div>

Propsโ€‹

PropTypeDefaultDescription
titlestringโ€”Page title text
subtitlestringโ€”Supporting subtitle below the title
breadcrumbsBreadcrumb[]โ€”Breadcrumb trail
userHeaderUserโ€”Current user โ€” shows name + avatar button
actionsReactNodeโ€”Right-side slot for buttons/menus
onUserClick / (onUserClick)() => voidโ€”Fires when the user avatar/name is clicked

TypeScript interfacesโ€‹

interface Breadcrumb {
label: string; // Display text
href?: string; // Link target โ€” last breadcrumb typically has no href
}

interface HeaderUser {
name: string;
email: string;
avatar?: string; // URL to avatar image โ€” falls back to initials if not provided
}

// Example
const breadcrumbs: Breadcrumb[] = [
{ label: 'Dashboard', href: '/dashboard' },
{ label: 'Tenants', href: '/tenants' },
{ label: 'Acme Corp' }, // current page โ€” no href
];

const user: HeaderUser = {
name: 'Jane Doe',
email: 'jane@acme.com',
};
Version history

See the Changelog for version history and breaking changes.