Playground

Page header

The top of a page: breadcrumbs, title, description and actions.

  • 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

PropTypeDefaultDescription
title requiredReactNode–The page title, rendered as a heading.
descriptionReactNode–One sentence under the title saying what the page is for.
breadcrumbsReactNode–Shown above the title: a `Breadcrumb` or `BreadcrumbsAuto`.
actionsReactNode–Buttons at the end of the title row. They wrap under the title on small screens.
level1 | 2 | 3 | 41The 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

ClassStylesheet
.page-headerpage-header.css
.page-header-actionspage-header.css
.page-header-descriptionpage-header.css
.page-header-rowpage-header.css
.page-header-textpage-header.css
.page-header-titlepage-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.