UI.MD

Page Header

A page-level header with title and optional description.

Installation

$
npx shadcn@latest add https://ui.mattdowney.com/r/page-header.json

Usage

import { PageHeader } from "@/components/ui/page-header"

Examples

Default

The title and description at the top of a page. It ships no bottom margin: put it in a Stack and let the container own the gap to whatever follows.

Dashboard

Overview of your workspace

With an action

A control seated on the heading's right, for the one control the section is about: a view switcher, a range picker. The title wraps rather than pushing the control off the end. Filters and table-wide actions are a different row and belong in TableToolbar below.

Subscriber growth

Signups over the last 30 days.

API Reference

PropTypeDefaultDescription
title*string-The page title.
descriptionstring-Optional supporting text below the title.
actionReactNode-A control seated on the heading's right, top-aligned to the title's cap. For the one control the section is about; filters and table-wide actions belong in TableToolbar under the heading instead.
size"sm" | "md" | "lg""lg"Ramp keyed to the type scale. sm: title text-sm, description text-1xs, 8px below. md: title text-lg, description text-sm, 16px below. lg: title text-2xl, description text-base, 24px below. The below gap only applies when children are present.
as"h1" | "h2" | "h3""h1"Heading element. A page has one h1; a section-level header should pass as="h2".
childrenReactNode-Content below the heading group. When present, PageHeader renders as a flex column and owns the gap between the group and this content via the size's below-gap token.