Header
Sticky top navigation bar with title, breadcrumbs, and right-side action slots.
Codeโ
- HTML ยท @primus/ui-core
- React
- Angular
<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>
import { PrimusHeader } from 'primus-react-ui';
<PrimusHeader
title="Primus Admin"
breadcrumbs={[{ label: 'Dashboard', href: '/dashboard' }, { label: 'Tenants' }]}
user={{ name: 'Jane Doe', email: 'jane@acme.com' }}
onUserClick={() => setProfileOpen(true)}
/>
<primus-header title="Primus Admin" [breadcrumbs]="breadcrumbs"
[user]="currentUser" (onUserClick)="openProfile()">
</primus-header>
Propsโ
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | โ | Page title text |
subtitle | string | โ | Supporting subtitle below the title |
breadcrumbs | Breadcrumb[] | โ | Breadcrumb trail |
user | HeaderUser | โ | Current user โ shows name + avatar button |
actions | ReactNode | โ | 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.