Skip to the page
Supply UI

Row

Things next to each other, lined up on their middles; it wraps onto more lines where they do not fit

Preview

HaircutColourBeard trimWash and dry
Invoice 0412Due 30 November

Use

The code of the preview above
import { Button, Chip, ItemText, Row, Stack } from '@/components/ui';

<Stack gap={6}>
  <Row gap={2}>
    <Chip>Haircut</Chip>
    <Chip>Colour</Chip>
    <Chip>Beard trim</Chip>
    <Chip>Wash and dry</Chip>
  </Row>
  <Row between>
    <ItemText title="Invoice 0412" note="Due 30 November" />
    <Button size="sm">Send</Button>
  </Row>
</Stack>

This page as text, for an AI

Options

OptionTypeWhat it does
between booleanSpreads them to both ends of the line.
center booleanMoves them all to the middle of the line, left to right (a row of buttons under a centred title).
gap 1 | 2 | 3 | 4 | 6 | 8 | 12The space between the things: 1–4 inside a group, 6 between groups, 8 between the parts of a screen, 12 between the sections of a public page.
nowrap booleanKeeps them on one line instead of wrapping.
stretch booleanMakes them as tall as the row: a sidebar beside its content.

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-row, ui-row--between, ui-row--center, ui-row--nowrap, ui-row--stretch.

With the CSS in parts (/ui/css/), it needs these, besides the ones every page loads:

components/input-group.css

In the examples

Small screens made with it and the rest of the kit. They work: click, type and choose in them.

Buttermilk pancakes4 servings
Flour
250 g
Milk
300 ml
Eggs
2
Butter
30 g
Cook for more Drag the servings and every amount follows
book.harbour.studioChecked every minuteUp
Two weeks99.79%
Answer212 ms
Last down9 Nov
Still up Two weeks of checks, the dips hatched

Classes this week

  • Wheel throwingTue 18:002 spots
  • GlazingThu 18:305 spots
  • Hand buildingSat 10:00Full
Loading, politely Grey shapes hold the place until the classes arrive
  1. Plan
  2. You
  3. Confirm
  4. Done
Join in three steps A plan, a name, a tick. Next stays off until each step is done.

Layout: states, do and don’t

Things next to each other; wraps. They are always lined up on their middles from top to bottom, so nothing is needed for that. between spreads them to both ends; center moves them all to the middle of the line, left to right (a row of buttons under a centred title), never for lining up; stretch makes them as tall as the row: a sidebar beside its content. A text field in a row with its button fills the room the button leaves.

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 Card is 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-height together with an aspect-ratio.
  • Don't nest a card in a card.
  • Don't put two <main>s on a page: a screen shown inside another page takes Main as="div".