PageHeader
Canonical page header - the top of a page, beneath the app's own header.
Pass its parts and it lays them out: a breadcrumb or back link, the title
with optional media, a count or badge and a subtitle, the page's actions,
and a switcher beneath between views of what the page shows. Every part
but the title is optional, and a row with nothing in it is not rendered.
It says what the page is; the controls that narrow or order a list sit in
a PageToolbar beneath it.
Usage
Best practices
Pass
titleand the parts the page has rather than composing rows by hand; the header owns wrapping, truncation and spacing, so every page reads the same.A count belongs in
metaorsubtitle, never in the title text; a back link belongs inbreadcrumb, never inactions.navswitches between views of the thing the page shows (a pillTabNavigationof routes). Type switchers, filters, sort and view belong in aPageToolbar, each once.Set
layout="stacked"and wrap each row inPageHeaderRowfor multi-row headers; the default"single"wraps only when a narrow viewport needs to protect the title or actions.PageHeaderis the sub-header below the appHeaderBar, not the app chrome itself - useSidebarProviderwithSidebarInsetorHeaderBarfor the top-level frame; itsstickyoffset assumes that header is present.
Props
PageHeader
PageHeaderTitle
Also exports
- component
PageHeaderActions - component
PageHeaderLead - component
PageHeaderRow - interface
PageHeaderSlotProps - component
PageHeaderTabs - const
usePageHeader