Page header
The top of a page: breadcrumbs, title, description and actions.
SourceStyles source@monoline/react 0.5.0Markdown for AI toolsbeta
- Built on native elements
- The title is a real heading (h1 by default); keep one h1 per page.
- Breadcrumbs and actions are slots, so they keep their own landmark and keyboard behaviour.
- Styles in one file:
page-header.css
Import
import '@monoline/css';
import {PageHeader} from '@monoline/react';
Not installed yet? Pick a route.
Copies the source and its styles into your project.
npx monoline add page-header
Usage
import {Breadcrumb, Button, PageHeader} from '@monoline/react';
<PageHeader
breadcrumbs={<Breadcrumb items={[{label: 'Home', href: '#'}, {label: 'Customers', href: '#'}, {label: 'Ada Example'}]} />}
title="Ada Example"
description="Joined in March. On the Team plan."
actions={<><Button>Export</Button><Button variant="solid">Edit customer</Button></>}
/>
Examples
Title, description and actions
Title only
Props
PageHeaderProps
| Prop | Type | Default | Description |
|---|---|---|---|
title required | ReactNode | – | The page title, rendered as a heading. |
description | ReactNode | – | One sentence under the title saying what the page is for. |
breadcrumbs | ReactNode | – | Shown above the title: a `Breadcrumb` or `BreadcrumbsAuto`. |
actions | ReactNode | – | Buttons at the end of the title row. They wrap under the title on small screens. |
level | 1 | 2 | 3 | 4 | 1 | The heading level, 1 to 4. Default 1: one per page. |
Data Attributes
State is exposed through attributes. Style it with these selectors, not with class toggles.
This component sets no state attributes.
CSS classes
| Class | Stylesheet |
|---|---|
.page-header | page-header.css |
.page-header-actions | page-header.css |
.page-header-description | page-header.css |
.page-header-row | page-header.css |
.page-header-text | page-header.css |
.page-header-title | page-header.css |
Customization
Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.
app.css
.page-header {
border-color: var(--accent);
}
Accessibility
- The title is a real heading (h1 by default); keep one h1 per page.
- Breadcrumbs and actions are slots, so they keep their own landmark and keyboard behaviour.