waffle
GraphWaffle
A grid of 100 cells, filled to the value. Write `73% — tests green` inside the tag.
- use it
- Good for a share shown as a grid of about a hundred cells.
- instead
- Labeled parts of a whole is Stack.
written
The value, then the caption after an em dash.
91%
182 of 200 green
91 percent. 182 of 200 green<GraphWaffle title="TESTS">91% — 182 of 200 green</GraphWaffle>install
command
coverage
One hundred cells. Value is how many are lit.
73%
73 of 100 tests green
73 percent. 73 of 100 tests greenimport { GraphWaffle } from "@/registry/default/graph-waffle/graph-waffle"
<GraphWaffle title="COVERAGE" value="73%" caption="73 of 100 tests green" />quota
Fewer cells. Same 0–1 value.
40%
seats used
40 percent. seats usedimport { GraphWaffle } from "@/registry/default/graph-waffle/graph-waffle"
<GraphWaffle
title="QUOTA"
value={0.4}
cells={40}
columns={8}
caption="seats used"
/>| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | — | Caption drawn on the top edge of the frame. |
| value | number | "73%" | — | Share from 0 to 1. Optional when children are Markdown. |
| children | Markdown | — | 73% — tests green |
| cells | number | 100 | Total cells in the grid. |
| columns | number | 10 | Cells per row. |
| caption | string | — | Muted line under the percent. |
| glyphs | "shade" | "ascii" | "hash" | "bar" | string[] | "shade" | Character set. shade is ·░▒▓█. ascii is .- =#@. Pass a preset or your own characters. |
| palette | "mono" | "duo" | "multi" | "mono" | mono is one accent plus muted. duo paints the second series with --graph-accent-2. multi cycles three accents. |
| corner | string | "+" | Character at each corner of the frame. |
| frame | "box" | "corners" | "rule" | "none" | "box" | box draws the dashed border. corners keeps only the corner marks. rule draws dashed lines above and below. none drops the border and padding, and puts the title above the content. |
| className | string | — | Passed to the outer frame. |