Layout

PageHeader

Page-level heading with named title, description, breadcrumb, and action regions, as a default header, a large title that collapses on scroll, or a full-bleed hero band.

import { PageHeader } from '@lostgradient/cinder';
pageheadinglayout
01

Overview

Reference usage

Page-level heading with named title, description, breadcrumb, and action regions, as a default header, a large title that collapses on scroll, or a full-bleed hero band.

Usage

svelte
<script lang="ts">
  import { PageHeader } from '@lostgradient/cinder';
</script>

<PageHeader title="Approvals" />

Create action, status and errors

A list page's create action is a createAction: a labelled primary button with a leading "+", such as "New agent", never an icon alone, drawn last in the actions region so it sits in the same place in every state, whether the list is empty or not. The empty state under it (EmptyState layout="page") repeats it with the same verb. It goes inert under a stale <StaleRegion> (mutating defaults to true). In a narrow header (32rem of its own width or less, a phone) the title takes the full row: the create button stays at the right of the title, and every other action drops to a row of its own under the title and the status. A status there wraps under the title with each item kept whole, unless one item is wider than the line, which breaks inside it rather than widen the page, and a vertical divider between status items is not drawn.

svelte
<script lang="ts">
  import { PageHeader } from '@lostgradient/cinder';
</script>

<PageHeader
  title="Agents"
  description="Agents run your chats, goals and schedules."
  createAction={{ label: 'New agent', href: '/agents/new' }}
/>

While a full-page ErrorState shows under the header, pass error so the header's primary buttons draw as secondary and Try again is the only primary.

status takes the page's status as a snippet and statusPlacement puts it beside the title (inline, on its first line) or under it (below, the default). An inline status and the actions are each one line box of the title's own size with their content centred in it, so they share the centre of the title's first line however the title wraps and whatever a control's height. The title wraps to two lines and then ends in an ellipsis; its tooltip carries the full text, from title or, when title is a snippet, from titleText. In a narrow pane, such as a chat's conversation, pass titleLines={1}: the title keeps one line and takes the free space first, and an inline status that no longer fits beside it moves under it.

Default and large headers compact their actions to the extra-small control size. Set compactActions={false} when the header has room for each action’s own control size.

In a narrow header (a phone) the actions drop to a row of their own under the title and the status. Pass narrowActions="beside-status" to put them at the inline end of the status's row instead, which gives that row's height back to the page; it suits a few compact actions above content that needs the room, such as a chat's context ring and More menu. With no status they sit beside the title instead, so they never take a row alone. A wide header is the same either way.

Flush by default, inset on request

The header draws no rule by default; pass divider for one. It is flush with the content beneath it, with no padding around it, so its title lines up with that content. Pass inset to pad it in from the edge of its container.

svelte
<script lang="ts">
  import { PageHeader } from '@lostgradient/cinder';
</script>

<PageHeader inset title="Allowed models" description="Which models agents may use." />

Decisions are never hidden

A page that waits on a decision puts it in decisions: approve, deny or edit for an approval, or Cancel for running or paused work. The group is drawn first among the actions and stays visible at every width; it is never put in the overflow menu. overflow holds the secondary actions behind one "More actions" button (overflowLabel renames it). An overflow action marked decision: true is drawn as a visible button beside the group instead of in the menu, so a list of actions that comes from data cannot hide one either.

svelte
<script lang="ts">
  import { Button, PageHeader } from '@lostgradient/cinder';
</script>

<PageHeader
  title="Refund order 4471"
  overflow={[
    { label: 'Copy link', onclick: () => {} },
    { label: 'Cancel run', decision: true, onclick: () => {} },
  ]}
>
  {#snippet decisions()}
    <Button variant="primary">Approve</Button>
    <Button>Deny</Button>
  {/snippet}
</PageHeader>

Large title

variant="large" sets the title at the large page-title step (28px). Once the title scrolls away, a sticky bar shows it at the default page-title size over the content, on a translucent surface that is opaque when the platform cannot blur or the person asks for less transparency. The bar is drawn just before the header, in the page's flow, so it stays stuck for the whole page; the heading itself stays where it is, and the bar is hidden from assistive technology.

collapsed is bindable and says whether the title has scrolled away. To show the title in an AppBar instead, bind it to the bar's titleVisible and turn off the header's own bar with collapsedBar={false}.

svelte
<script lang="ts">
  import { AppBar, PageHeader } from '@lostgradient/cinder';

  let collapsed = $state(false);
</script>

<AppBar title="Runs" titleVisible={collapsed} />
<PageHeader variant="large" title="Runs" bind:collapsed collapsedBar={false} />

Hero

variant="hero" is a full-bleed band at page level, never a card inside the page: place it outside the page's padded column, and its content is capped at the page's content width. It has an eyebrow (neutral, never the accent colour), a display title, facts such as a KeyFacts row, the actions beneath the title at their own size, and at the inline end either a focal value or media. It looks finished with no media at all, and none of the examples here use a photo.

tone sets the band: plain draws none, tint is a light or dark indigo wash, accent is a saturated indigo gradient with light text, and night is near-black with an indigo glow. Every tone keeps its text at 4.5:1 or better, and indigo is the only accent. On accent and night the hero provides its controls' defaults: a primary Button is a white fill with an indigo label, a secondary Button is translucent, and a SegmentedControl sits on a translucent track. The page sets nothing for this.

A dotted pattern fades in from the inline end of every hero, and art adds one large icon glyph at low opacity in the bottom inline-end corner. Both are hidden from assistive technology and are not drawn when the person asks for more contrast or forces colours. art is not drawn when focal is set: one focal element per screen.

focal holds one large tabular value first, then its label in a <small>, then an optional Meter. The layout answers to the hero's own width through a container query, not the viewport: below 720px it is one column with the focal value first, and the title and the focal value are sized in container units.

titleSoft adds a lighter phrase straight after the title, in the same heading at the same size, so a brand name can carry it: the title is weight 760 and the phrase 380, and the heading keeps one accessible name. Include any leading space or punctuation in it.

Each tone, without a focal value

svelte
<script lang="ts">
  import { Button, KeyFacts, PageHeader } from '@lostgradient/cinder';
  import { Martini } from '@lucide/svelte';
</script>

{#each ['plain', 'tint', 'accent', 'night'] as const as tone (tone)}
  <PageHeader
    variant="hero"
    {tone}
    eyebrow="Denver"
    title="Poor Decisions"
    titleSoft=", made easier"
    description="Happy hours near you, open right now."
  >
    {#snippet facts()}
      <KeyFacts items={[{ value: 'LoDo' }, { value: '14 open now' }, { value: 'Until 7 PM' }]} />
    {/snippet}
    {#snippet actions()}
      <Button variant="primary">Find a spot</Button>
      <Button>See the map</Button>
    {/snippet}
    {#snippet art()}<Martini aria-hidden="true" />{/snippet}
  </PageHeader>
{/each}

Each tone, with a focal value

svelte
<script lang="ts">
  import { Button, Meter, PageHeader } from '@lostgradient/cinder';
</script>

{#each ['plain', 'tint', 'accent', 'night'] as const as tone (tone)}
  <PageHeader
    variant="hero"
    {tone}
    eyebrow="Run 4471"
    title="Refund order 4471"
    description="Waiting on your approval to issue the refund."
  >
    {#snippet decisions()}
      <Button variant="primary">Approve</Button>
      <Button>Deny</Button>
    {/snippet}
    {#snippet focal()}
      <span>$84.20</span>
      <small>Refund amount</small>
      <Meter value={62} ariaLabel="Share of the order refunded" />
    {/snippet}
  </PageHeader>
{/each}

At phone width

Below 720px of the hero's own width the focal value comes first and the copy follows in one column. A hero in a 375px frame:

svelte
<script lang="ts">
  import { Button, PageHeader } from '@lostgradient/cinder';
</script>

<div style="inline-size: 375px;">
  <PageHeader
    variant="hero"
    tone="accent"
    eyebrow="Neighborhood"
    title="Capitol Hill"
    description="Eleven bars with a happy hour today."
  >
    {#snippet actions()}
      <Button variant="primary">Show them</Button>
    {/snippet}
    {#snippet focal()}
      <span>11</span>
      <small>Open now</small>
    {/snippet}
  </PageHeader>
</div>
Live preview

Basic page header

Approvals

3 pending, 12 resolved

Schedules

Create and manage recurring automation schedules.

02

When to use

Use when
  • Rendering a route-level heading that needs consistent spacing and border treatment across pages.
  • Pairing page context and supporting copy with optional right-aligned controls.
  • Opening an overview page with a full-bleed hero band: an eyebrow, a display title, facts and one focal value.
Avoid when
  • Rendering section-scoped headings within page content — use section-heading.
  • Building a marketing page with photography and several columns of copy — compose container (see its hero-section example).
03

Examples

Basic page header

Page-level heading with named title, description, breadcrumb, and action regions.

Create action, status and a full-page error

A list page’s create action is a labelled primary button with a leading "+", never an icon alone, in the same place in every state. status sits beside the title or under it, a long title wraps to two lines and then ends in an ellipsis with the full title in its tooltip, and error draws the header’s primary buttons as secondary so Try again is the only primary.

Hero tones, with and without a focal value

A full-bleed hero band in each tone: plain, a tinted indigo wash, a saturated indigo gradient and a near-black night band. It looks finished without media; art adds one faint glyph, and a focal value replaces it.

Large title and decisions that are never hidden

A large title that collapses into a sticky bar once it scrolls away. The approval decisions stay visible beside it, and the overflow menu holds only secondary actions; an overflow action marked as a decision is drawn as a button instead.

04

Props

Props for page-header
Name
Type
Default
Description
title required text Page-level heading content. Rendered inside the headingLevel heading; snippets must emit phrasing content.
titleSoft text A lighter phrase drawn straight after the title, in the same heading at the same size, such as ", made easier" after a brand name. Include any leading space or punctuation.
headingLevel 123456 1 Heading level for the title element. Defaults to 1.
variant 'default' | 'large' | 'hero' 'default' The header's layout: default, large (a large title that collapses into a sticky bar on scroll) or hero (a full-bleed band).
tone 'plain' | 'tint' | 'accent' | 'night' 'plain' The band a hero header draws: plain, tint, accent or night. The other variants ignore it.
eyebrow text A short neutral line above a hero title, such as the section or the place.
description text Optional supporting content rendered below the title; snippets must emit phrasing content.
breadcrumbs snippet Optional breadcrumb navigation rendered above the heading row.
actions snippet Optional trailing actions (buttons, menus, controls).
compactActions boolean true Draws default and large header actions at the compact size. Set to false to use each control’s own size.
actionsNote text A short caption for the actions, under their row: which version each button runs on, or a "Connect a provider" link that says why a button is held. It sits at the inline end under the actions in a wide header and starts the line under them below 640px of header width, and the actions' group is described by it (aria-describedby). A button the caption explains can point its own aria-describedby at actionsNoteId.
actionsNoteId text The id of the actionsNote element, for a button that points its own aria-describedby at it. Defaults to an id derived from the header's.
decisions snippet The decision action group: approve, deny or edit for an approval, or Cancel for running or paused work. It is drawn first among the actions, is never put in the overflow menu, and stays visible at every width.
overflow PageHeaderOverflowAction[] Secondary actions behind one "More actions" menu button. An action marked decision is drawn as a visible button instead, so a decision is never hidden in the menu.
overflowLabel text 'More actions' The accessible name of the overflow menu button.
facts snippet A hero header's facts beneath the title, such as a KeyFacts row.
media snippet Optional media at the inline end of a hero header. A hero needs none to look finished.
art snippet One large icon glyph drawn at low opacity at the bottom inline-end corner of a hero band. It is decorative and hidden from assistive technology, and it is not drawn when focal is set.
focal snippet A hero header's focal value at the inline end: one large tabular value first, then its label in a <small>, then an optional Meter. Below 720px of header width it sits above the title.
collapsed bindable boolean false Whether a large title has scrolled away. Bind it to pair the header with an AppBar's titleVisible.
collapsedBar boolean true Whether a large header draws its own sticky bar with the title once the title scrolls away. Turn it off when an AppBar shows the title instead.
createAction { /** The button's words and its accessible name, such as "New agent" or "Start run". */ label: string; /** Render the action as a link to this address in…
Show full type { /** The button's words and its accessible name, such as "New agent" or "Start run". */ label: string; /** Render the action as a link to this address instead of a button. */ href?: string; /** Called when the action is pressed. Not called while the action is inert. */ onclick?: (event: MouseEvent) => void; /** Disables the action: not focusable, not pressable. Prefer `inertReason`, which keeps focus. */ disabled?: boolean; /** * Makes the action inert and says why: it stays focusable, ignores the press, carries * `aria-disabled`, and the reason describes it ("Off until the list loads"). Use it where the * page cannot create yet but should still tell a keyboard user so, such as under a full-page * error. Under a stale `<StaleRegion>` the region's own reason does this. */ inertReason?: string; /** * Whether creating changes something, so the action goes inert under a stale `<StaleRegion>`. * @default true */ mutating?: boolean; /** A custom icon in place of the "+"; decorative, the label names the action. */ icon?: Snippet; }
A list page's create action, drawn last in the actions region as a labelled primary button with a leading "+", never an icon alone, in every state of the page. Under a full-page error it draws as secondary, so the error's Try again is the one primary.
error boolean false A full-page error state shows under this header. The header's primary buttons then draw as secondary, so the error's "Try again" is the only primary on the page.
inset boolean false Insets the header with padding around it. Off by default: the header is flush with the content beneath it, so its title lines up with that content. Pass it where the header should sit in from the edge of its container.
divider boolean false Draws a rule under the header. Off by default: space separates the header from the page, and the rule is opt-in.
status snippet The page's status, such as a dot and "Waiting on you". It is a snippet so the page owns the words and the tone; see statusPlacement for where it sits.
statusPlacement 'inline' | 'below' 'below' Where status sits: inline beside the title on its first line, or below the title.
narrowActions 'own-row' | 'beside-status' 'own-row' Where the actions go in a narrow header (a phone). own-row puts them on a row of their own under the title and the status. beside-status puts them at the inline end of the status's row instead, which saves that row's height, for a page whose actions are a few compact controls and whose content below needs the room, such as a chat; with no status they sit beside the title. A wide header is the same either way.
titleText text The title's plain text, for the tooltip that shows the full title when it is cut off, when title is a snippet. A string title is used as it is.
titleLines 1 | 2 2 How many lines the title may take before it ends in an ellipsis. With 1 the title keeps one line and takes the free space first: an inline status that no longer fits beside it moves under it, for a narrow pane such as a chat's conversation.