# Page Header (Notchset): prompt.md (v1.0.0)

- id: `page-header` · version 1.0.0 · block · pro (Pro)
- category: App screens
- build: Base UI (one set of files; its dependencies follow the build)
- install (this build): `npx shadcn@latest add @beautiful-ui-pro/page-header`
- npm dependencies: none
- registry dependencies: utils, https://beautiful-ui.dev/r/notchset-foundation.json
- docs: https://beautiful-ui.dev/components/page-header
- The install command carries everything this item needs (files, CSS, tokens, npm and registry dependencies). Prefer it to copying source by hand.

An entity page's header: breadcrumb, follow, share, a ⋯ menu and the main action at ⌘↵, a condensed title with a status menu and meta, and tabs with counts; past 28px of scroll it folds the title away and keeps the actions.

## Build it
- Stack: React 19 (`ref` is a plain prop), TypeScript, Tailwind CSS v4 utilities, a shadcn-initialised project with the `@/*` alias.
- Packages: none beyond React.
- Files: `components/ui/notchset/blocks/page-header.tsx`; shared code: `lib/beautiful-ui/notchset/blocks.tsx`, `lib/beautiful-ui/notchset/instrument.tsx`, `lib/beautiful-ui/notchset/root.ts`.
- Registry dependencies, installed with it automatically: shadcn `utils` (cn), `notchset-foundation`.
- Builds: one set of files for both, but its dependencies come in Base UI and Radix builds. Install the one that matches the project (see Install): a free item's bare URL installs the Base UI build of it and its dependencies.
- Exports to keep: `PageHeader`, and every exported type.
- CSS: the install adds the notchset foundation (tokens, keyframes, motion levels) to your global stylesheet once. Nothing to import by hand.
- Re-running `add` (or `--overwrite`) re-applies those rules: put overrides in your own CSS, never in the installed rules.
- Tokens: retheme with the `--notchset-*` custom properties (`--notchset-check`, `--notchset-control-edge`, `--notchset-draw-from`, `--notchset-ease-bloom`, `--notchset-ease-glide`, `--notchset-ease-key-down`, `--notchset-ease-key-up`, `--notchset-ease-travel`, `--notchset-fade`, `--notchset-focus-color`, `--notchset-focus-inset`, `--notchset-grow-to`, `--notchset-key-down`, `--notchset-key-up`, `--notchset-life-from`, `--notchset-life-ms`, `--notchset-node-blink`, `--notchset-node-bloom`, `--notchset-node-delay`, `--notchset-plate-color`, `--notchset-rise-from`, `--notchset-rule`, `--notchset-scan-to`, `--notchset-scroll`, `--notchset-signal`, `--notchset-sweep-to`, `--notchset-travel`). Never add Tailwind colour classes inside the component.

```tsx
import { PageHeader } from "@/components/ui/notchset/blocks/page-header";
```

## Parts

| Part | data-slot | What it is for |
|---|---|---|
| `PageHeader` | `page-header` | The header and the scrolling tab content under it. |

Style a part with `[data-slot="<slot>"]` selectors or its `className`; keep the attributes when editing.

## Sound
- Keep every `data-slot` and `data-sound` attribute: the sound layer reads them.
- Installing this item adds no audio. Nothing plays until the app mounts `SoundProvider` once (install: `npx shadcn@latest add https://beautiful-ui.dev/r/notchset-sound.json`, import from `@/components/ui/notchset/sound-provider`); `useSound()` gives `muted` and `setMuted` for a mute control. Without a provider the audio engine never loads.

## Match the original
- Read `components/ui/notchset/blocks/page-header.tsx` as the reference implementation before changing or recreating anything, and match it: sizes, colours per theme, motion timings, copy and behaviour.
- If you deviate (a prop you can't honour, a style you changed, a dependency you swapped), say so in your reply, part by part.
- Keep the accessibility contract, the keyboard map and the motion levels listed below.

## Use it when
- page header, entity header, detail page header, sticky header, condensing header, tabs with counts, status menu, Notchset
- The top of a detail page (an agent, a project, a customer) with its status, people and main actions

### Not when
- A list or index page: a smaller heading and a filter bar fit better
- A site header: use Site Header

## Mistakes
- Give the block a height (640px by default): the header condenses on the block's own scroll, not the page's

## Usage

```tsx
"use client";

import * as React from "react";
import { PageHeader } from "@/components/ui/notchset/blocks/page-header";

export function AgentHeader() {
  const [tab, setTab] = React.useState("overview");
  const [status, setStatus] = React.useState("live");
  const [following, setFollowing] = React.useState(false);
  return (
    <PageHeader
      breadcrumb={["ACME LABS", "AGENTS", "PLANNER"]}
      title="Planner"
      statuses={[
        { value: "live", label: "LIVE", tone: "live" },
        { value: "paused", label: "PAUSED", tone: "paused" },
      ]}
      status={status}
      onStatusChange={setStatus}
      following={following}
      followers={12}
      onFollowChange={setFollowing}
      primary={{ label: "NEW EVAL RUN", onAction: () => "EVAL RUN QUEUED" }}
      tabs={[
        { value: "overview", label: "OVERVIEW" },
        { value: "runs", label: "RUNS", count: "31,406" },
      ]}
      tab={tab}
      onTabChange={setTab}
    >
      <p>Tab content</p>
    </PageHeader>
  );
}
```

## Props

| Prop | Type | Default | What it does |
|---|---|---|---|
| `breadcrumb / title / description` | `string[] / string / ReactNode` |  | The path (its last part hides when the condensed title appears), the 52px title and a line under it. |
| `people / meta` | `{ initials, name? }[] / { label, value }[]` |  | Avatars and the meta line; a person without a name is a +n chip. |
| `statuses / status / onStatusChange` | `{ value, label, description?, tone }[]` |  | The status pill and its menu; tone is live, paused or degraded. |
| `following / followers / onFollowChange` | `boolean / number` |  | FOLLOW: the bell fills and the count rolls. |
| `shareUrl` | `string` |  | SHARE copies it and shows LINK COPIED. |
| `actions` | `{ id, label, shortcut?, tone?, onSelect? }[]` |  | The ⋯ menu; return a string to confirm in the toast. |
| `primary` | `{ label, onAction }` |  | The ink button; ⌘↵ runs it from anywhere in the block. |
| `tabs / tab / onTabChange` | `{ value, label, count? }[]` |  | Tabs with counts; the underline stretches between them. |
| `children` | `ReactNode` |  | The selected tab's content; it scrolls under the header. |

Full docs: https://beautiful-ui.dev/components/page-header

## Customising
- Colours: the component reads your shadcn tokens (`--background`, `--foreground`, `--border` …), refined by the `--notchset-*` tokens. The signal colour is `--notchset-signal` (it falls back to `--destructive`). Set tokens on `:root`, or on any container to retheme one area.
- Dark mode follows the `.dark` class on an ancestor (the shadcn and next-themes convention).
- Update later by re-running the install with `--overwrite` (review the diff if you edited it). Changelog: https://beautiful-ui.dev/r/changelog.json

## Keyboard

| Keys | Action |
|---|---|
| ⌘↵ / Ctrl+Enter | Run the main action |
| ← → | Move between tabs |
| ↑ ↓ Home End / Esc | Move in a menu / close it |

## Performance

- Plain DOM; the condensed state changes once each way, not per scroll frame.

## Responsive

- The top row wraps its actions under the breadcrumb on narrow widths; tabs scroll sideways.

## Motion inventory

| Interaction | What moves |
|---|---|
| Condense | Past 28px the title block folds (360ms) and the name and status slide into the top row 120ms later |
| Tabs | The underline stretches between tabs (340ms); content rises in |
| Menus | Unroll on grid rows (320ms), roll up faster (180ms) |
| Follow | The follower count rolls |

## Accessibility contract (preserve when editing)
- The breadcrumb is a nav with the current page marked; FOLLOW is a toggle button (aria-pressed)
- The status and ⋯ menus are menus with arrow keys; Esc closes them and returns focus to their button, and a press outside closes them
- Tabs are a tablist with arrow keys; the content is a tabpanel labelled by its tab
- The folded title block is inert; SHARE's confirmation and the toast are announced

## Install

```bash
npx shadcn@latest add @beautiful-ui-pro/page-header
```

Pro item: needs the `@beautiful-ui-pro` registry in `components.json` and `BEAUTIFUL_UI_TOKEN` in `.env.local` (https://beautiful-ui.dev/account). Setup: https://beautiful-ui.dev/docs/pro. Your components.json `style` picks the build: radix-*, new-york and default get Radix, base-* gets Base UI.

## Credits
- Built on shadcn/ui (https://ui.shadcn.com)

The notchset foundation (the tokens listed above, keyframes and motion levels) installs once with the first component; its CSS is public at https://beautiful-ui.dev/r/notchset-foundation.json.
