Item text
In code: ItemText
A name and a line under it: a person and their role, a product and its price. Tight, so the two read as one. size="lg" for the heading of a card: "Ines Duarte / Tutor".
Preview
Use
import { ItemText, PatternAvatar, Row, Stack } from '@/components/ui';
<Stack gap={4}>
<Row nowrap gap={3}>
<PatternAvatar name="Ines Duarte" />
<ItemText title="Ines Duarte" note="Tutor · Maths and physics" />
</Row>
<Row nowrap gap={3}>
<PatternAvatar name="Linen tote" />
<ItemText title="Linen tote" note={<span className="ui-mono">£24.00</span>} />
</Row>
<ItemText size="lg" title="Harbour Room" note="Seats 8 · £40 an hour" />
</Stack>Options
| Option | Type | What it does |
|---|---|---|
title Needed | ReactNode | The name: a person, a product. |
note | ReactNode | The quieter line under it: a role, a price. |
size | "lg" | Its size, one step from the theme's Size: sm, md (default) or lg. |
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 span.ui-item-text > .ui-item-title + .ui-item-note; ui-item-text--lg.
In the examples
Small screens made with it and the rest of the kit. They work: click, type and choose in them.
- Noor Haddad#1187
- Otis Brandt#1188
- Yuki Tanabe#1189
Classes this week
- Wheel throwingTue 18:002 spots
- GlazingThu 18:305 spots
- Hand buildingSat 10:00Full
Layout: states, do and don’t
A name and a line under it: a person and their role, a product and its price, a file and its size. Set tight so the two read as one; never build the pair from two loose lines of text. size="lg" for the heading of a card.
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".