# DescriptionList

Supply UI 1.1.0. Showing things.

Facts about one thing, name left and value right, with a hairline between the rows: details, contacts, opening hours. An item's `icon` goes before its name. `plain` drops the lines, for a few short facts in a card

Facts about one thing: name on the left, value on the right, a hairline between the rows

## Options

| Option | Type | Default | What it does |
| --- | --- | --- | --- |
| `items` (needed) | `{ label: ReactNode; value: ReactNode; icon?: ReactNode; }[]` |  | `icon` (a Lucide icon) goes before the name: a phone, a pin, a clock. |
| `plain` | `boolean` |  | Without the lines between the rows: a few short facts in a card. |

It also takes the 279 attributes of the element or UI SDK part it renders (`className`, `aria-label`, events…).

## Without React

Classes: `dl.ui-dl` > `div.ui-dl-row` > `dt` (+ `span.ui-dl-icon`) + `dd`; `ui-dl--plain`

## CSS parts

With the CSS in parts (`/ui/css/`), it needs: `components/description-list.css`, `components/prose.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)
- Details from below: An order rises as a drawer you can drag (https://www.supply.family/ui/#scene-orders)
- An invoice that adds up: Change a quantity or a price; the lines and VAT follow (https://www.supply.family/ui/#scene-invoice-lines)
- Codes that check themselves: Type a code and the total answers (https://www.supply.family/ui/#scene-coupon)

## Showing things: notes

**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 `Table` turn into blocks on a phone; give it `scroll` only 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`, `Calendar` or `Empty`: 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.
