Split
A side part and a main part next to each other (a sidebar and its page, a rail and its list). They stack when the box is too narrow for the main part to keep at of its width ("50%" by default). Follows its box, not the window.
Preview
- Noor HaddadHarbour RoomMon 09:30
- Otis BrandtQuay RoomTue 14:00
- Yuki TanabeGarden RoomThu 17:15
Use
import { ItemText, List, ListItem, Split, Stack, Stat } from '@/components/ui';
<Split gap={6} at="55%">
<Stack gap={1}>
<span className="ui-overline">This week</span>
<Stat label="Bookings" value="41" note="6 more than last week" />
</Stack>
<List>
<ListItem>
<ItemText title="Noor Haddad" note="Harbour Room" />
<span className="ui-mono">Mon 09:30</span>
</ListItem>
<ListItem>
<ItemText title="Otis Brandt" note="Quay Room" />
<span className="ui-mono">Tue 14:00</span>
</ListItem>
<ListItem>
<ItemText title="Yuki Tanabe" note="Garden Room" />
<span className="ui-mono">Thu 17:15</span>
</ListItem>
</List>
</Split>Options
| Option | Type | What it does |
|---|---|---|
at | string | The share of the box the main part must keep before the two stack: "50%" by default, or a share like "55%". |
gap | 1 | 2 | 3 | 4 | 6 | 8 | 12 | The space between the two parts; the page's gutter by default. |
side | string | The width the side part (the first child) starts from, as a CSS length: "16rem". |
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 div.ui-split + --split-at, --side.
In the examples
Small screens made with it and the rest of the kit. They work: click, type and choose in them.
Bookings
Orders
- #1187 · Noor Haddad
- #1188 · Otis Brandt
- #1189 · Yuki Tanabe
Layout: states, do and don’t
A side part and a main part next to each other (a sidebar and its page, a rail and its list) that stack when the box is too narrow for the main part to keep at of its width (a share like 55%; a length is never wider than the box). Follows its box, not the window, so it works in a card. Use it, never a one-line row, for anything sidebar-like inside 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".