Page header
A React block (a whole screen) in Beamline's Hotel & restaurant app.
The top of a record or project page: breadcrumb, title with status, description and meta, a primary action with secondary actions that fold into a More menu when the width runs out, and tabs underneath; on long pages it can condense into a compact bar pinned to the top as you scroll.
Use it for
- The top of a record, project or settings page: where it sits, what it is, its state, what you can do with it and its sub-views.
Not for
- App-level navigation (app-shell or sidebar).
- A section heading inside a page (a heading and a button).
Anatomy
- breadcrumb
- media (optional avatar or icon tile)
- title
- status badge (dot and word)
- description
- meta row (people, updated time)
- actions: primary, secondaries, More menu
- tabs (with counts)
- tab panels (children)
- compact bar (condense): title that scrolls back to the top, status, primary action
States
- all actions shown
- without ResizeObserver, measure actions once and keep the header usable
- some actions folded into More (measured against the space they need)
- only the primary and More
- an action disabled
- an action running (loading: a loader in front of its label, clicks ignored, size kept)
- a destructive menu item
- no tabs
- tab selected (controlled or not)
- condensed (condense: the header has scrolled by; a compact bar with title, status and the primary action is pinned to the top of the scrolling area)
Keyboard
- Tab: breadcrumb links, actions, More, then the tab list
- More: Enter, Space or ↓ opens; ↑/↓ move; Enter runs; Esc closes and focus returns
- Tabs: ←/→ move between tabs, Home/End to the ends
- The compact bar's title returns to the top of the page and moves focus to the page title; the bar is inert while hidden
Motion
Actions fold at a stop without travel (a reflow places, only a choice travels; the trail folds its middle sooner in a tight room); the tab indicator slides between tabs; the menu opens on --motion-in. The compact bar fades in on --motion-in with a 6px drop and leaves on --motion-out; under reduced motion it only fades.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title (required) | ReactNode | — | Heading shown above the content. Required. |
description | ReactNode | — | Supporting text beneath the label or heading. Defaults to no supporting text. |
breadcrumb | BreadcrumbItem[] | — | Where the page sits, from the top level to this page. |
status | { label: string; tone?: BadgeTone } | — | The record's state, as a word with a dot. |
media | ReactNode | — | An avatar or icon tile before the title. |
meta | ReactNode | — | A line under the description: people, dates, ids. |
actions | PageHeaderAction[] | — | The first is the primary action and always shows; the others fold into More, from the end, when space runs out. |
menu | MenuItem[] | — | Items that always live in More. |
tabs | PageHeaderTab[] | — | Tabs below the page heading; omitted by default to show no tab navigation. |
tab / defaultTab / onTabChange | string | — | tab: The selected tab, controlled or not. defaultTab: Initial active tab value; defaults to the first supplied tab. onTabChange: Reports active tab after a change; no callback by default. |
children | ReactNode | — | Tab panels (TabsContent) or the page below the header. |
headingLevel | 1 | 2 | 1 | Default 1. |
className | string | — | Classes on the documented visual root; no override by default. |
condense | boolean | false | Once the header scrolls out of view, a compact bar (title, status, primary action, back to top) stays pinned to the top of the scrolling area. For long pages whose title and main action should stay at hand. |
classNames | PageHeaderClassNames | — | Classes for the named visual parts; no part overrides by default. |
tabsMode | "panels" | "navigation" | — | panels: the tabs switch TabsContent children on this page (tabs and tab panels). navigation: they switch pages or routes (a nav whose current item is aria-current="page", same look). Default: panels when the children hold TabsContent, else navigation. |
style / ref | CSSProperties / Ref<HTMLDivElement> | — | style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default. |
menuClassNames | MenuClassNames | — | Classes for the menu component's named parts; no overrides by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no inline overrides by default. |
tab | string | — | The selected tab, controlled or not. |
defaultTab | string | — | Initial active tab value; defaults to the first supplied tab. |
onTabChange | ((value: string) => void) | — | Reports active tab after a change; no callback by default. |
ref | Ref<HTMLDivElement> | — | Receives the documented root element; no ref by default. |
Built from
- breadcrumb
- badge
- button
- dropdown-menu
- tabs
Dependencies
lucide-react
Import
import { PageHeader } from "@beamline/page-header";
Get it
Page header is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent
More in Hotel & restaurant
- Reservation desk: A front desk's bookings without a room for a night, beside the rooms that could take them: bookings grouped by room type with their stay, party and…
- Table service: A restaurant table's service in three places sharing one order. The floor: tables placed on a plan by drag, arrow keys or typed numbers (Shift and an…
- Counter service: A counter and its kitchen. The counter: the order on the left (its name, eat here / takeaway / drive-through, each line with its options and quantity…
- Room readiness: Housekeeping's rooms for the day: condition, occupancy, the front desk's plan (arriving with its time or not known, departing, staying on), who is…
- Stay folio: A stay's folio: the chosen folio's lines filtered by kind, posted and pending said, voided lines on request, every row in the ledger's currency; beside…
- Guest messages: Conversations with guests beside the booking each is about, for a host stand, salon front desk or hotel. Guests waiting for an answer come first with how…
- Shift briefing: A team's pre-shift briefing for a restaurant service (or any shift with bookings): the venue, the service and when its reservation snapshot was read, an…
- Map explorer: A map with one operational layer over real ground (an optional map base: relief, lakes, streams, woods, roads), explored without losing your place; its…
- Turntable review: A 3D asset reviewed on a turntable. The object large at the angle in view with front, side and back said, standing on a plate whose rim shows the twelve…