Header
<zn-header>
ZnHeader
Headers show a page title with breadcrumbs, a back link, an icon and navigation.
<zn-header caption="John Jones" previous-path="#" navigation="[{"path":"#","title":"Overview"},{"path":"#","title":"Activity"}]"> <zn-icon round src="test1@example.com" size="36"></zn-icon> <a href="#" slot="breadcrumb">Customers</a> <a href="#" slot="breadcrumb">Active</a> </zn-header>
caption is the page title. previous-path adds a back link, content in the default
slot (here an avatar) sits before the title, and navigation adds a row of tabs under it, each
with a path and a title.
The breadcrumb slot renders inline with the title: each slotted link is followed by a
> separator and the caption becomes the final, unlinked item in the trail.
Examples
Hide Breadcrumb
Set hide-breadcrumb to suppress the trail and show only the title.
<zn-header caption="John Jones" hide-breadcrumb> <a href="#" slot="breadcrumb">Customers</a> <a href="#" slot="breadcrumb">Active</a> </zn-header>
Title Only
With only a caption, the header is a plain page title.
<zn-header caption="John Jones"></zn-header>
Description
description adds a line under the title. Add inline-description to put it beside
the title instead, such as for a count.
<zn-header caption="John Jones" description="Customer since March 2024"></zn-header> <zn-header caption="Invoices" description="128 invoices" inline-description></zn-header>
Icon
icon shows an icon before the title.
<zn-header icon="person" caption="John Jones"></zn-header>
Actions
Put buttons in the actions slot. A Button Menu keeps them
on one line: buttons marked primary or secondary show while there is room, and the
rest move into its overflow menu.
<zn-header caption="John Jones"> <zn-button-menu slot="actions"> <zn-button primary icon="edit">Edit</zn-button> <zn-button secondary icon="mail">Email</zn-button> <zn-button secondary icon="call">Call</zn-button> <zn-button>Export</zn-button> <zn-button category="manage">Merge</zn-button> <zn-button category="manage">Archive</zn-button> </zn-button-menu> </zn-header>
Expanding Actions
Expanding actions in the actions slot open a panel
from an icon button.
Recent labels
Pinned notes
<zn-header caption="John Jones"> <zn-button-menu slot="actions"> <zn-button primary icon="edit">Edit</zn-button> <zn-button secondary icon="mail">Email</zn-button> </zn-button-menu> <zn-expanding-action icon="new_label" method="drop" slot="actions"> <p>Recent labels</p> </zn-expanding-action> <zn-expanding-action icon="sticky_note_2" method="drop" slot="actions"> <p>Pinned notes</p> </zn-expanding-action> </zn-header>
Slots
| Name | Description |
|---|---|
| (default) | The default slot. |
Properties
| Name | Description | Reflects | Type | Default |
|---|---|---|---|---|
description
|
A line of muted text under the caption. |
string
|
- | |
inlineDescription
inline-description
|
Sets the description beside the caption rather than under it, e.g. a row count. |
boolean
|
false
|
|
updateComplete |
A read-only promise that resolves when the component has finished updating. |
Parts
| Name | Description |
|---|---|
base |
The component’s base wrapper. |
header-right |
The container that wraps the actions slot. |