Components / surfaces
Header
A heading row: an icon, a title, a count and one action.
Summary
A heading row: an icon, a title, a count and one action.
| APG pattern | none |
| Built on | native elements |
| Status | self-tested |
| Since | 0.7.0 |
<Header title="Projects" count={12} level={2} action={<Button size="sm">Add project</Button>} />
<Card header={<Header icon={<Icon name="kanban" />} title="Open items" count={42} />}>
<Rows items={items} />
</Card>
Anatomy
A <div data-se="header"> holding, in order, icon, title, count and action. The title is a <p> unless level is passed, in which case it is that heading. It fills Card's header slot — a section is a Card with a Header — and stands alone above a list.
| Part | Element | Required |
|---|---|---|
action | <span> | no |
count | <span> | no |
icon | <span> | no |
subtitle | <p> | yes |
text | <div> | no |
title | <title> | yes |
<div data-se="header">
<span data-part="icon"><svg aria-hidden="true">…</svg></span>
<h2 data-part="title">Projects</h2>
<span data-part="count">12</span>
<span data-part="action"><button data-se="button" …>Add project</button></span>
</div>
data-se="header" names the anatomy and data-part="header" names a region of a panel; they sit on different attributes, and a Header in a Card's header slot carries both — the slot on the wrapper the card draws, the anatomy on the row inside it. The two words mean one thing: the row at the top.
Properties
| Property | Values | Default | What it does |
|---|---|---|---|
icon | React.ReactNode | none | An <Icon> before the title. Decorative — the title carries the meaning. |
title | string | required | The words. A noun that names what sits under the row: Projects, Open items. |
subtitle | React.ReactNode | none | One line under the title, in muted body text: what the thing is or does. With a subtitle the title and it stack, and the actions align to the top of the row. |
count | number | string | none | How many of the thing there are, drawn beside the title in the code face. A number or a short string such as 12 of 40; it is text, read after the title. |
action | React.ReactNode | none | The controls pinned to the trailing edge: a Button, a Link, a Menu, a status, or a few buttons side by side. |
level | 1 | 2 | 3 | 4 | 5 | 6 | none | The title's heading level. Omitted, the title is a <p>, as Dialog's is — a heading's level belongs to the document outline, and only the page knows it. Pass it where the row heads a section of the page. |
as | keyof React.JSX.IntrinsicElements | none | The element to render. div by default; header where the row heads a sectioning element. |
States
_None. Rest is the only condition it has._
Behavior
None. The action does what the action does.
Accessibility
The title is a heading only when the caller says so. Omit level and the title is a <p>, the way Dialog's title is: a heading the page did not place is a wrong turn in the outline. Pass level where the row heads a section of the page, and the title is that heading.
The count is read after the title, as text. Projects, 12. It carries no role and no live region; a count that changes while the reader watches is not announced.
The icon is decoration. It sits in the shared icon box with aria-hidden; the title carries the meaning.
One action. A row with two controls is a Toolbar's job, and a Toolbar has a keyboard contract this row does not.
Keyboard
None of its own. The action is a normal tab stop.
Roles, states and properties
_None written. The elements carry their own._
Focus
Never takes focus itself.
Screen reader
Not recorded as verified. Stage 4 of the readiness ladder — driving each component with VoiceOver and NVDA — is unstarted across the package, and no component should claim otherwise until docs/journal/ records the session that did it.
Contrast and target size
npm run check:contrast audits every color pair this component uses across all four skins, light and dark, and fails the build on a shortfall. Two waivers are on the record in docs/audit/DEFERRED.md.
It sets no target size of its own; anything interactive inside it brings its own.
Tested
test/apg/batch-c.test.jsxtest/apg/card-header.test.jsxtest/apg/panel-regions.test.jsxtest/browser/card-header.spec.mjstest/browser/header-title-size.spec.mjstest/browser/header-wrap.spec.mjstest/browser/table.spec.mjs
Known gaps
_No upstream requirement is recorded as not applicable._
Appearance
A row, items centered, a space step between them, the action pushed to the trailing edge. The row wraps: what does not fit beside the title goes under it and starts a line of its own, and the title keeps its line. The title is text-lg, semibold, with the heading leading and tracking: one step above body text, so a title reads as a title before its weight is noticed. It shares its weight, leading and tracking with Dialog's title and Feed's article title, and sets its own size. The count is the code face, muted, with tabular figures, the way Meter and Stat set a number. At level={1} the title is the page's, and takes the heading role's size (--se-text-2xl, with the heading leading and tracking) instead of text-lg. Levels 2 to 6 keep the large step, because they name panels and sections. Standalone it draws no padding and no rule: the layout around it sets the distance. Inside a Card's header slot the card draws the padding and the hairline.
| Token | Used for |
|---|---|
--se-font-code | font-family |
--se-icon-sm | block-size, font-size, inline-size |
--se-leading-body | line-height |
--se-leading-heading | line-height |
--se-space-2 | gap |
--se-text | color |
--se-text-2xl | font-size |
--se-text-lg | font-size |
--se-text-md | font-size |
--se-text-muted | color |
--se-text-sm | font-size |
--se-tracking-heading | letter-spacing |
--se-weight-semibold | font-weight |
Motion
None.
Content
The title is a noun, one or two words, sentence case. Projects, Open items, This week. Not a sentence and not an instruction.
The count is the number, formatted. 12, 3 of 10. The title says what it counts, so the count says nothing else.
The action is a verb. Add project, See all. One; the row has room for one.
Usage
Above a list, or at the top of a section. Standalone over a Rows, a DataTable or a Feed; inside a Card as its header slot. Both are the same row.
The first of three. Header, Body and Footer are the regions of the panel template. Each stands alone and draws no padding and no rule, and a Card or a Dialog holds them in the slots of the same names.
Not a page title, unless the page says so. At the top of PageShell.Main, with level={1} and an eyebrow above it, this row IS the page header — the pattern is written in PageShell's Usage. Anywhere else it heads a section inside the page, which is why its level is the caller's and defaults to no heading at all. The size follows the level only at 1: that is the one title a page has, and the one that must not read at body size.
When not to use it. For several controls, a Toolbar. For a heading with a paragraph under it, the type roles. For a key and a value, Rows with its facts form.
Notes
Its own component, the owner's word of 15 Oct 2026. The review's first shape was a slot on Card; the apps also drew the same row above lists with no frame, so it stands alone.
count is a local part. value was considered — it is the shared name for a rendered value beside its control — and rejected: nothing here is a control, and a count beside a title is not a reading.
The row wraps, since 0.16. It did not, and a title beside a wide control in a narrow card was squeezed to nothing: measured at 240px, a title next to a three-segment control was 0px wide and the row ran 38px past the card. The action's own margin used to push it to the trailing edge, which sent a wrapped control to the far end of an empty line. The free space between the title and the action is now an item of the row's own, so a wrapped action starts its line. Putting it on the title as a margin was tried first and failed: the title is a paragraph, and a page that resets paragraph margins outside a layer takes the margin away. A control wider than the card itself still runs past it, and that is the control's to solve, not the row's.
The count sits about a pixel above the title's baseline, and stays there. Measured at 0.8px in davor-anic and 1.0px in portfolio, because the row centers boxes and the two are different sizes. Aligning the row on the baseline was tried: the title then sits at the top of a row that holds a button, four pixels off its center. A pixel on the count is the smaller fault.
The title defaults to a paragraph, not a heading. Dialog set the precedent and the type layer states the rule: a component must not pick a heading level. level hands the choice to the page, which is the only thing that knows.
The title moved up a step on 14 Nov 2026, the owner's word. It read text-md, the step body text is on, sharing one recipe with Dialog's title and Feed's article title. In a card that put the title and the text under it at one size in every skin, told apart by weight alone; the owner saw it in the drawn cards. Card's own spec already named crosshead, at the lg step, as the card title's role. Dialog and Feed keep text-md; whether they follow is the owner's.