Page header
In code: PageHeader
The top of a screen: its title on the left and its actions on the right
Preview
Bookings
Friday, 27 November
Use
The code of the preview above
import { Button, PageHeader, Row, Stack } from '@/components/ui';
import { Plus } from 'lucide-react';
<PageHeader>
<Stack gap={1}>
<h3 className="ui-title">Bookings</h3>
<p className="ui-muted">Friday, 27 November</p>
</Stack>
<Row gap={2}>
<Button>Export</Button>
<Button variant="primary">
<Plus />
New booking
</Button>
</Row>
</PageHeader>Options
No options of its own.
It also takes the 280 attributes of the element or UI SDK part it draws: className, aria-label, events and the rest.
Without React
The same look on any HTML, with the classes ui-page-header.
With the CSS in parts (/ui/css/), it needs these, besides the ones every page loads:
components/prose.cssLayout: states, do and don’t
Title on the left, actions on the right.
States. Layout follows the box it is in, not the window: Split, Grid, AppShell and the site parts stack when their box is narrow, at any width of the window.
Do
- Space with
gap(Stack,Row,Grid), never with margins on children. - Put the page's sections straight on the page, under their titles; a
Cardis one thing a person picks or acts on. - Check every screen at 320, 375 and 768 px with the narrow check of rule 10.
Don't
- Don't give a box a fixed width, or a
min-heighttogether with anaspect-ratio. - Don't nest a card in a card.
- Don't put two
<main>s on a page: a screen shown inside another page takesMain as="div".