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

Six accounts sit in a portfolio table and each one is somewhere between just-signed and fully adopted. SproutRow gives
each item 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 key. The four stages are fixed and discrete: no
half-stages, no interpolation, and presets recolor the glyphs without reshaping one.

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

## Try it

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

<SproutRow
  data={accounts}
/>
```

## When to use it

Use it for account or project maturity across a small set, a health column in a portfolio table, or per-item lifecycle
in a KPI card. Continuous values belong in MiniBar and trends in Sparkline; past about twelve items the row stops being
readable.

## Sizing

**with category labels**

```tsx
<SproutRow data={accounts} labels />
```

**missing ≠ seed (null draws a soil tick only)**

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

## Variants

Labels are off by default, since the row usually sits beside its own row label and the heights carry the ordering.
`label="value"` prints each item's stage number instead.

```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: seed is stage
0 and gets its own glyph, and "no data yet" is a different state from "just planted". Values outside `[0, 3]` round and
clamp to the nearest real stage, seed or bloom, instead of drawing a fractional or out-of-bounds glyph.

## Four homes

**In a sentence**

```tsx
<p>
  Account health this week{" "}
  <span className="mc-inline">
    <SproutRow data={accounts} height={18} summary={false} />
  </span>{" "}
  — two at bloom, one still seed.
</p>
```

**In a table cell**

```tsx
<td>
  <SproutRow data={[{ label: "Acme", value: 3 }]} />
</td>
```

**In a KPI card**

```tsx
<div className="kpi">
  <span className="figure">4 / 6</span>
  <span className="unit">at leaf or better</span>
  <SproutRow data={accounts} height={30} />
</div>
```

**In a tab header**

```tsx
<button className="tab">
  Accounts <SproutRow data={accounts} height={14} />
</button>
```

## Accessibility

The accessible name summarizes the row: **"4 items; 1 at bloom, 1 at seed."** The interactive entry roves the items with
←/→ or hover and announces each as **"Acme: bloom, stage 4 of 4."**, the stage name plus a 1-of-4 index. A missing item
reads "…: no data." 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, press `Escape`, or
press outside the chart. 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). |
| `fontSize` | `number` | Type size of the value and stage labels, in viewBox units. Defaults from `height`. |
| `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).
