Skip to content
mdxcn is now part of Shadcn Labs. details

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.
instead
Actual versus a target is Bullet. Parts of a whole is Stack.

written

The value, then the caption after an em dash.

[ DISK ]

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.

[ SHIPPED ]

67%

characters, not a progress bar

67 percent characters, not a progress bar
import { GraphMeter } from "@/registry/default/graph-meter/graph-meter"

<GraphMeter title="SHIPPED" value="67%" caption="characters, not a progress bar" />

coverage

Fewer ticks. Tighter meter.

[ COVERAGE ]

92%

tests passing

92 percent tests passing
import { GraphMeter } from "@/registry/default/graph-meter/graph-meter"

<GraphMeter title="COVERAGE" value={0.92} ticks={10} caption="tests passing" />
[ PROPS ]
PropTypeDefaultDescription
titlestring—Caption drawn on the top edge of the frame.
valuenumber | "67%"—0 to 1. Optional when children are Markdown.
childrenMarkdown—67% — of the disk
ticksnumber14Number of character slots.
captionstring—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.
cornerstring"+"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.
classNamestring—Passed to the outer frame.