# Stat

Supply UI 1.1.0. Showing things.

One number with its label. Open, with no box: a row of them in a `Grid` is the facts of a page. `icon` (a Lucide icon) sits in a soft tile over it

One number with its label: "Orders / 128 / +12% this week". `icon` (a Lucide icon) sits in a soft tile over it.

## Options

| Option | Type | Default | What it does |
| --- | --- | --- | --- |
| `label` (needed) | `ReactNode` |  | What the number is: "Orders". |
| `value` (needed) | `ReactNode` |  | The current value, when your state holds it (controlled); use with `onValueChange`. |
| `icon` | `ReactNode` |  | A Lucide icon, shown in a soft tile over the label. |
| `note` | `ReactNode` |  | A small line under the number: "+12% this week". |

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

## Without React

Classes: `ui-stat…`, `ui-icon-tile` first inside

## CSS parts

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

## In the examples

- The month in three numbers: A figure, its change, and the line that led there (https://www.supply.family/ui/#scene-numbers)
- 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)
- Split the bill: Slide the tip, set the people, send the links (https://www.supply.family/ui/#scene-split-bill)
- 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)

## 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.
