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

bars

GraphBars

Two small histograms, before and after. Write `- before: 2 4 3 5 2`. For labels ranked by value, use Rank.

use it
Good for a before and after, or any two small histograms.
instead
A ranked list is Rank.

before / after

[ THROUGHPUT ]
███ ████ ████████ ███

before

████ ███████ █████████████ ████

after

<GraphBars title="THROUGHPUT" palette="duo">

- before: 2 4 3 5 2
- **after**: 2 4 3 5 2

</GraphBars>

install

command

draft to shipped

[ DRAFT TO SHIPPED ]
██ ████ █████████ ██

draft

edit
█████ ███████ ██████████████ ███████

shipped

<GraphBars title="DRAFT TO SHIPPED" processor="edit">

- draft: 1 2 2 3 1
- **shipped**: 3 5 4 6 5

</GraphBars>
[ PROPS ]
PropTypeDefaultDescription
titlestring—Caption drawn on the top edge of the frame.
fromBarSeries—Left series. values is an array of relative heights. Optional when children are Markdown.
childrenMarkdown—- before: 2 4 3 5 2
toBarSeries—Right series. Set size to lg for the larger group.
processorstring—Optional label between the two groups.
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.