Page Header
The top of a page: breadcrumb or parent link, your heading with status badges, description, metadata, page actions that fold into a menu, tabs and a toolbar.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
sticky | boolean | false | Keep a condensed bar with the title and the primary action once the title has scrolled out of view. |
parent-href | string | — | Overrides the target of the parent link derived from the breadcrumb. |
parent-label | string | — | Overrides the text of the parent link derived from the breadcrumb. |
more-actions-label | string | — | Accessible name of the "More actions" button. Empty: "More actions" in the page language. |
Slots
| Name | Description |
|---|---|
breadcrumb | Where the page sits: usually a c2-breadcrumb. Hidden below 600px. |
parent | A link to the parent page, shown below 600px instead of the breadcrumb. Without it, the link is derived from the breadcrumb. |
leading | A visual before the title: an icon, an avatar, a logo. Hidden below 600px. |
(default) | The page title: your heading element, usually an <h1>. |
title-suffix | Status after the title, such as c2-badges. |
description | A sentence under the title. |
meta | Facts about the page: a c2-description-list, dates, owners. |
actions | Page actions. Mark the main one primary; set overflow-priority on the others to choose which fold first. |
navigation | Tabs below the title, usually links with aria-current="page" on the current one. |
toolbar | A row of search and filters at the bottom of the header. |
Events
| Name | Type | Description |
|---|---|---|
condensed-change | CustomEvent<CondensedChangeEventDetail> | A sticky page header's title scrolled out of view or back in. Does not bubble. |
overflow-change | CustomEvent<OverflowChangeEventDetail> | The set of actions folded into "More actions" changed. Does not bubble. |
CSS parts
Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.
| Name | Description |
|---|---|
base | The <header> element containing every region. |
context | Container wrapping the breadcrumb slot; hidden below 600px. |
parent | Container wrapping the parent slot, whose fallback is the link derived from the breadcrumb; shown below 600px. |
title-row | The row containing the title area and the actions. |
leading | Box wrapping the leading slot; it sizes the slotted visual. |
actions | Container wrapping the actions slot, the More actions button and the primary action. |
more-actions | The "More actions" button. |
navigation | Container wrapping the navigation slot. |
toolbar | Container wrapping the toolbar slot. |
condensed | The condensed bar of a sticky page header. |
CSS custom properties
Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-page-header--padding-top | padding | 20px | |
--c2-page-header--padding-right | padding | 24px | |
--c2-page-header--padding-bottom | padding | 16px | |
--c2-page-header--padding-left | padding | 24px | |
--c2-page-header--gap | pixel | 12px | Space between the rows. |
--c2-page-header--background-color | color | transparent | |
--c2-page-header--color | color | — | |
--c2-page-header--border-bottom | border | none | |
--c2-page-header--sticky-top | pixel | var(--c2-app-shell--sticky-offset, 0px) | Where a sticky page header's condensed bar stays. Inside a c2-app-shell it follows the shell. |
--c2-page-header--z-index | number | 5 | Stacking of a sticky page header above the page. |
--c2-page-header--transition-duration | time | 180ms | |
--c2-page-header__title--font-size | font-size | 24px | |
--c2-page-header__title--font-weight | font-weight | 600 | |
--c2-page-header__title--line-height | line-height | 1.25 | |
--c2-page-header__title--line-clamp | number | 2 | |
--c2-page-header__title--color | color | #18181b | |
--c2-page-header__title--min-width | pixel | 240px | Room kept for the title before actions fold. |
--c2-page-header__title__narrow--font-size | font-size | 20px | |
--c2-page-header__leading--size | pixel | 40px | |
--c2-page-header__description--color | color | #52525b | |
--c2-page-header__description--font-size | font-size | 14px | |
--c2-page-header__meta--color | color | #71717a | |
--c2-page-header__meta--font-size | font-size | 12px | |
--c2-page-header__meta--gap | pixel | 4px 16px | |
--c2-page-header__actions--gap | pixel | 8px | |
--c2-page-header__link--color | color | rgb(2, 101, 220) | The parent link. |
--c2-page-header__link--font-size | font-size | 14px | |
--c2-page-header__more--size | pixel | 36px | |
--c2-page-header__more--border-radius | border-radius | 8px | |
--c2-page-header__more--border | border | 1px solid #bcbcc6 | |
--c2-page-header__more--background-color | color | #ffffff | |
--c2-page-header__more--color | color | #18181b | |
--c2-page-header__more__hover--background-color | color | #f4f4f5 | |
--c2-page-header__focus--outline | outline | 2px solid rgba(2, 101, 220, 0.4) | |
--c2-page-header__navigation--margin-top | pixel | 4px | |
--c2-page-header__condensed--height | pixel | 48px | |
--c2-page-header__condensed--background-color | color | rgba(255, 255, 255, 0.92) | |
--c2-page-header__condensed--backdrop-filter | backdrop-filter | blur(12px) | |
--c2-page-header__condensed--border-bottom | border | 1px solid #e4e4e7 | |
--c2-page-header__condensed__title--font-size | font-size | 14px | |
Text and languages
The text the component shows, in English. It shows another language when the app adds one with addTranslations, under page-header, and the nearest lang asks for it; any message not translated stays in English. {0}, {1}… stand for the values a message carries. Languages guide.
| Key | English | Values |
|---|---|---|
moreActions | More actions | — |
backTo | Back to {0} | {0} label |