Cover
A picture filling a band, the whole width of the window, with a solid panel over it that holds the words: the top of a hotel's or a restaurant's page. Text never sits straight on the picture, so it reads on any image.
Preview
Harbour Studio
Haircuts and colour by the water, open until eight
Use
import { Button, Cover, Row } from '@/components/ui';
<div className="ui-grow">
<Cover seed="Harbour Studio" bleed={false} size="md">
<h2 className="ui-title">Harbour Studio</h2>
<p className="ui-muted">Haircuts and colour by the water, open until eight</p>
<Row>
<Button variant="primary">Book a time</Button>
</Row>
</Cover>
</div>Options
| Option | Type | What it does |
|---|---|---|
children Needed | ReactNode | What is said over the picture: a title, a line, a button or a small form. It sits on a solid panel. |
align | "center" | "start" · default 'start' | Where the panel sits: low at the start of the column (default), or in the middle. |
bleed | boolean · default true | Run the full width of the window (on by default), or stay a rounded block in the page column. |
image | ReactNode | A real picture (an <img> or <video>) to fill the band; it wins over the painted one. |
seed | string | Paints the picture from this word when there is no image. |
size | "md" | "lg" | "full" · default 'lg' | Height: md (about half the window), lg (most of it, the default), full (all of it). |
It also takes the 279 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 section.ui-cover.ui-bleed > .ui-cover-media + .ui-cover-inner.ui-container > .ui-cover-panel.
With the CSS in parts (/ui/css/), it needs these, besides the ones every page loads:
components/cover.cssShowing things: states, do and don’t
The top of a public page: a picture (painted from seed, or image={<img … />}) filling a band the width of the window, with a solid panel over it holding a title, a line and a button or a small form. size: md, lg (default), full. align="center" puts the panel in the middle. bleed={false} keeps it a rounded block in the column. Text never sits straight on the picture.
States. Lists, tables and boards have three more states besides their content: empty (Empty, with the first action inside), loading (Skeleton) and failed (Alert tone="danger"). A chosen row shows in ink, never in the brand colour.
Do
- Put numbers, dates and codes in
ui-mono(in a table cell,ui-num, which also aligns them). - Let a
Tableturn into blocks on a phone; give itscrollonly when it is read down its columns. - Show a status in words and colour together (
Badge tone="success"with "Paid"), never colour alone.
Don't
- Don't put a card round a
Table,List,Cells,CalendarorEmpty: they draw their own box. - Don't truncate a name or a price to fit; let it wrap. Truncate only file names and addresses.
- Don't use the status colours (success, warning, danger, info) for anything but those meanings.