Page Header

A page's title, description, breadcrumb and actions.

Invoice sync

Live

Owner Maya ChenRuns hourly1,284 runs this month

Copies new invoices from the ledger into the finance workspace and flags any over 10,000.

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/page-header

Usage

import { Button } from "./ui/uicontext/components/Button.ts"import { PageHeader } from "./ui/uicontext/components/PageHeader.ts"
export const ProjectsHeader = <M>(h: Html.H<M>, newProject: M) =>	PageHeader(h, {		title: "Projects",		description: "Plan and share work across your team.",		actions: Button(h, { tone: "primary" }).on("click", newProject).children("New project"),	})

Examples

A long title in a narrow column

The title wraps in balanced lines; the actions move under it.

Sign-in link expires before the email arrives for people on corporate mail servers

API reference

Options

PageHeader options
NameTypeDefaultDescription
titlerequiredstring—The page's name, as its heading.
headingLevel1 | 2 | 31The title's heading level: 1 for a page, 2 or 3 for a section inside one; 1 by default.
titleIdstring—The heading's id, so a region can name itself by it.
titleStyleStyle—StyleX styles for the heading, applied after its own.
focusboolean—Moves focus to the heading once it appears, as after a route change, so screen readers start there.
descriptionstring—A sentence under the title on what the page is for.
actionsView.Input—Buttons at the end of the title row, such as New or Share.
breadcrumbView.Input—Where the page sits, above the title, in a Breadcrumb landmark.
accessoryView.Input—Something right after the title, such as a status badge or a favorite button.
metadataView.Input—A line of facts under the title: an owner, a date, a count.

Accessibility

  • The title is a heading (h1 unless you set headingLevel); with focus, it takes focus after navigation so screen readers start there.
  • The breadcrumb is a nav landmark named Breadcrumb.

Source