# SproutRow (/docs/charts/sprout-row)

SproutRow answers "how mature or healthy is each item in a small set?" Each item is one of four growth stages — **seed →
sprout → leaf → bloom** — and the glyph height is strictly monotonic, so taller always means further along and the
ordering reads without the legend. The stages are discrete and there are exactly four; there are no half-stages, because
a growth metaphor must not fake continuity.

```tsx
<SproutRow
  data={[
    { label: "Acme", value: 3 },
    { label: "Beta", value: 2 },
    { label: "Gamma", value: 3 },
    { label: "Delta", value: 1 },
    { label: "Echo", value: 0 },
    { label: "Foxtrot", value: 2 },
  ]}
  labels
  title="Account health"
  height={30}
  step={24}
/>
```

The key, shown once: **seed → sprout → leaf → bloom**.

## Install

```tsx
import { SproutRow } from "@microcharts/react/sprout-row";

<SproutRow data={accounts} title="Account health" />
```

Setup (package + stylesheet): [Quickstart](/docs/quickstart#set-up-with-an-ai-agent) or paste [`/agent-setup.md`](/agent-setup.md) into your agent.


## When to use it

- **Good for** — account or project maturity across a small set, a health column in a portfolio table, or per-item
  lifecycle in a KPI card.
- **Avoid for** — continuous values (MiniBar), trends (Sparkline), or more than about twelve items.


## Variants

```tsx
<SproutRow data={accounts} label="value" />
<SproutRow data={[{ label: "A", value: 2 }, { label: "B", value: null }, { label: "C", value: 0 }]} />
```

## Edge cases

```tsx
<SproutRow data={[]} title="No accounts" />
```

```tsx
<SproutRow data={[{ label: "A", value: 2 }, { label: "B", value: null }]} />
```

```tsx
<SproutRow data={[{ label: "A", value: -3 }, { label: "B", value: 12 }]} />
```

Empty data draws just the frame. A `null` value renders only the soil tick — visibly distinct from a seed, which is
stage 0 and gets its own glyph. Values outside `[0, 3]` round and clamp to the nearest real stage (seed or bloom) rather
than drawing an out-of-bounds or fractional glyph.


## Why this default

Labels are off by default because the row usually sits beside its own row label, and at micro scale the glyphs alone
carry the ordering. The one-line key — seed → sprout → leaf → bloom — appears once above the demos, and after that the
height does the work. A `null` value is a real gap: it draws only the soil tick, distinct from a seed, because "no data
yet" is not "just planted". Presets recolor the glyphs but never reshape a stage; the four stages are fixed and never
interpolated.

## Accessibility

The accessible name summarizes the row — **"4 items; 1 at bloom, 1 at seed."** The interactive entry roves the items
with ←/→ (or hover), announcing each as **"Acme: bloom, stage 4 of 4."** — the stage name plus a 1-of-4 index — and
reads "…: no data." for a missing item. A ring lifts the focused glyph.

The interactive entry follows the shared [interaction contract](/docs/accessibility#one-interaction-contract):
arrow keys rove between units on both axes, `Home` and `End` jump to the ends, and a click, tap, `Enter` or
`Space` selects a unit — pinning its readout so it survives blur, until you select it again or press `Escape`.
On touch, a tap pins and a drag scrubs.

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `data` (required) | `{ label, value }[]` | value = stage 0–3. |
| `labels` | `boolean` | Category labels under the slots. |
| `label` | `"none" \| "value"` | Print the stage number above each glyph. |
| `step` | `number` | Horizontal spacing between glyph slots (default 16; widens for labels). |
| `animate` | `boolean` | (interactive) Opt-in entrance motion when the chart mounts client-side — add `import "@microcharts/react/motion"` once. Inert on the server, on hydrated server HTML, and under `prefers-reduced-motion`. |

Plus the shared grammar — `data`, `domain`, `color`, `title`, `summary`, `format` — and the layout props (`width`, `height`, `className`, `style`) that every chart accepts. Interactive entries also share `animate` and `live`, and — wherever a chart has more than one navigable unit — `onActive`, `onSelect`, `selectedIndex` and `defaultSelectedIndex`; and — wherever the chart shows a hover value — `readout`. See [the shared grammar](/docs/quickstart#the-shared-grammar).
