# Row

Supply UI 1.1.0. Layout.

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

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

## Options

| Option | Type | Default | What it does |
| --- | --- | --- | --- |
| `between` | `boolean` |  | Spreads them to both ends of the line. |
| `center` | `boolean` |  | Moves 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 \| 12` |  | The 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` | `boolean` |  | Keeps them on one line instead of wrapping. |
| `stretch` | `boolean` |  | Makes 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 renders (`className`, `aria-label`, events…).

## Without React

Classes: `ui-row`, `ui-row--between`, `ui-row--center`, `ui-row--nowrap`, `ui-row--stretch`

## CSS parts

With the CSS in parts (`/ui/css/`), it needs: `components/input-group.css`, besides the ones every page loads.

## In the examples

- Cook for more: Drag the servings and every amount follows (https://www.supply.family/ui/#scene-recipe)
- Still up: Two weeks of checks, the dips hatched (https://www.supply.family/ui/#scene-uptime)
- Loading, politely: Grey shapes hold the place until the classes arrive (https://www.supply.family/ui/#scene-loading)
- Join in three steps: A plan, a name, a tick. Next stays off until each step is done. (https://www.supply.family/ui/#scene-checkout)
- Set up, one step at a time: Open a step, mark it done, watch the bar (https://www.supply.family/ui/#scene-setup)
- Mark the allergens: Pick from the list and the menu line writes itself (https://www.supply.family/ui/#scene-allergens)
- Add without leaving: A dialog takes the details; the list grows behind it (https://www.supply.family/ui/#scene-new-client)
- Out of ten: A low score opens a question, a high one says thanks (https://www.supply.family/ui/#scene-score)
- Fresh by seven: Reserve loaves the night before. The total keeps up. (https://www.supply.family/ui/#scene-bakery)
- An invoice that adds up: Change a quantity or a price; the lines and VAT follow (https://www.supply.family/ui/#scene-invoice-lines)
- A licence for the team: Pick the use and the people; five or more pay less (https://www.supply.family/ui/#scene-font-licence)
- Where the month went: Pick a category to see its share (https://www.supply.family/ui/#scene-budget)
- A sidebar with sections: Pick a section; its numbers change beside it (https://www.supply.family/ui/#scene-studio-sidebar)
- A dock that floats: The chosen tool shows its name; the rest stay icons (https://www.supply.family/ui/#scene-dock)
- The top of a website: Links in a row, panels of links under them (https://www.supply.family/ui/#scene-site-header)
- Jump anywhere with ⌘K: Pages and actions in one search (https://www.supply.family/ui/#scene-jump)
- File, View, the old way: Menus of an application, ticks and choices included (https://www.supply.family/ui/#scene-editor-menus)
- Sections on one page: Pills switch what the profile shows (https://www.supply.family/ui/#scene-profile)
- Write, and see it sent: Type on the left; drag the line to make room (https://www.supply.family/ui/#scene-newsletter)
- Fit the badge: Drag and zoom the photo into the round frame (https://www.supply.family/ui/#scene-badge)
- Room by room: Swipe through the finished rooms, or use the arrows (https://www.supply.family/ui/#scene-rooms)
- When you are open: Close a day with a switch and its hours step aside (https://www.supply.family/ui/#scene-hours)
- Bill the minutes: Start, stop, and every stretch lands in the list (https://www.supply.family/ui/#scene-timer)
- Two weeks away: Tap the first day, then the last (https://www.supply.family/ui/#scene-time-off)
- A free morning for Biscuit: Days with room are marked. The times follow the day. (https://www.supply.family/ui/#scene-vet)
- Keep the streak: Minutes a day, and the run so far (https://www.supply.family/ui/#scene-streak)
- When the box comes: Type or pick the day, then the part of it (https://www.supply.family/ui/#scene-delivery)
- Vote, then see: Results stay hidden until you have picked (https://www.supply.family/ui/#scene-poll)
- Who is next: Drag a walk-in up the queue; the waits follow (https://www.supply.family/ui/#scene-queue)
- What people said: The average, how it splits, and a voice from it (https://www.supply.family/ui/#scene-reviews)
- Hand the shift over: Tick what is done. The ring fills as you go. (https://www.supply.family/ui/#scene-handover)
- Who has arrived: Find a guest and check them in at the door (https://www.supply.family/ui/#scene-check-in)
- Share with a link: A popover with the switch and the link to copy (https://www.supply.family/ui/#scene-share)
- Screens, fairly: A bar turns amber, then red, as the day runs out (https://www.supply.family/ui/#scene-screen-time)
- Who is on today: A name opens a card about the person (https://www.supply.family/ui/#scene-shifts)

## Layout: notes

**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"`.
