meter
GraphMeter
A progress bar drawn with `=` characters, with dashes for the empty part. Write `67% — of the disk` inside the tag.
- use it
- Good for one value between 0 and 1, shown as a fill.
written
The value, then the caption after an em dash.
78%
of 500 GB
78 percent of 500 GB<GraphMeter title="DISK">78% — of 500 GB</GraphMeter>install
command
shipped
Dashes stay empty until the fill animates in.
67%
characters, not a progress bar
67 percent characters, not a progress barimport { GraphMeter } from "@/registry/default/graph-meter/graph-meter"
<GraphMeter title="SHIPPED" value="67%" caption="characters, not a progress bar" />coverage
Fewer ticks. Tighter meter.
92%
tests passing
92 percent tests passingimport { GraphMeter } from "@/registry/default/graph-meter/graph-meter"
<GraphMeter title="COVERAGE" value={0.92} ticks={10} caption="tests passing" />| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | — | Caption drawn on the top edge of the frame. |
| value | number | "67%" | — | 0 to 1. Optional when children are Markdown. |
| children | Markdown | — | 67% — of the disk |
| ticks | number | 14 | Number of character slots. |
| caption | string | — | Muted line under the meter. |
| 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. |