Skip to Content
BBRICKSv0.7.4
KitPatterns

PageHeader

The mock's topbar title block: h1 30/800, the muted subtitle (max 620px), actions at the end.

import { PageHeader } from '@ergasti/bricks';

Examples

Title, subtitle and actions

The page title is the page's <h1>; actions sit at the end and wrap under it on a phone.

Code
import { Button, PageHeader } from '@ergasti/bricks';

function Header() {
  return <PageHeader title="Creators" subtitle="Everyone in your program, and what they sold" actions={<><Button size="sm">Export CSV</Button><Button size="sm" variant="ink">Invite</Button></>} />;
}

Props

Prop

Type

Design guidance

How the BRICKS design system uses PageHeader. Written in docs/content/components/PageHeader.md; the props above are read from the code, which wins where the two disagree.

The page's title block: an h1, a muted one-line subtitle and optional actions at the end; put one at the top of every screen's content.

It is the mock's topbar title (.topbar h1 / p): h1 30 / 800 in the display font, a subtitle in --ink-3 up to 620px wide, actions aligned to the end. Every Brand screen opens with one ("Creators · Your creators, groups, join requests and invitations"); the PR Portal composes it under its crumb (its 28px title via --page-title-fs, THEME-GAPS G7).

Anatomy

  1. Row: .kit-pagehead, flex, space-between, 16px gap, 24px under it.
  2. Title: h1, --page-title-fs (30px), 800, letter-spacing -0.2px.
  3. Subtitle (optional): p, --ink-3, 6px under the title, max --page-sub-max (620px).
  4. Actions (optional): .kit-pagehead-act, flex, 10px gap.

Variants

SetupLookWhen to use
Title onlyh1 aloneSimple pages.
Title + subtitleDefaultEvery brand screen.
With actionsButtons at the endA page-wide action: Export CSV, "+ Request a challenge".

States

Static. Long subtitles wrap at 620px; actions stay top-aligned.

Usage

<PageHeader title="Creators" subtitle="Your creators, groups, join requests and invitations"
  actions={<Button size="sm" onClick={exportCsv}>Export CSV</Button>} />
<PillTabs label="Creators" idPrefix="creators" value={tab} onChange={setTab}>
  <PillTabs.Tab value="mine" count={304}>My creators</PillTabs.Tab>
  <PillTabs.Tab value="requests" count={6}>Join requests</PillTabs.Tab>
</PillTabs>
<PageHeader title="Motivation" subtitle="Challenges, bonuses and gifts that keep your creators selling" />

Where it appears

  • Brand › every screen › page title + subtitle (BrandHome, BrandCreators, BrandFindCreators, BrandCoupons, BrandMotivation, BrandWallet, BrandAnalytics, BrandSettings).
  • PR Portal › topbar crumb, h1, subtitle, tools (composed; PR inventory).

Guidelines

Do

  • One per page, matching the nav item's name.
  • Subtitle: one sentence saying what the page holds.

Don't

  • Don't put filters here; they belong in the list's toolbar.
  • Don't use more than two actions.

RTL and Arabic

  • Mirrors with flex; title letter-spacing should be 0 for Arabic (the display font). Example: "صنّاع المحتوى" / "صنّاع المحتوى بتوعك والمجموعات وطلبات الانضمام والدعوات".

Tokens

--font-family-display, --page-title-fs, --page-sub-max, --ink-3.

Accessibility

  • It renders an h1. AppHeader also renders the page title as an h1, so use PageHeader only where no AppHeader title is drawn, never both; cards below use h2.
  • Actions are your own buttons; give icon-only ones a label.

Found in the source

  • No roles, ARIA attributes or key handling are set in this component's own source; it renders native elements and the components it composes.

Read from the component's source and tests. See Accessibility for the patterns the library follows.

See also: Button · Accordion · HeroCard · KeyValue

Source

src/kit/patterns/PageHeader.tsx (line 5) on GitHub.

On this page