Charts

Bar Chart

Build bar charts with stacking, labels, and custom shapes

Bar charts compare values across categories using rectangular bars.

Simple Bar Chart

A basic bar chart with two data series.

Stacked Bar Chart

Use stack-id to stack bars within the same category.

Horizontal Bar Chart

Set layout="vertical" on <BarChart> for horizontal bars.

Bar Chart with Labels

Place <LabelList> as a child inside <Bar>:

Negative Values

Use <Cell> to color positive and negative bars differently.

BarChart props

PropTypeDefaultDescription
dataArray[]Data array
widthnumber—Chart width
heightnumber—Chart height
layout'horizontal' | 'vertical''horizontal'Layout direction
barGapnumber | string4Gap between bars in same category
barCategoryGapnumber | string'10%'Gap between bar categories
syncIdstring—Sync hover across charts

Bar props

PropTypeDefaultDescription
dataKeystring | number | FunctionrequiredKey from data
fillstring—Bar fill color
stackIdstring—Stack ID
barSizenumber—Bar width in pixels
maxBarSizenumber—Maximum bar width
activeIndexnumber—Pin a bar as always active
hidebooleanfalseHide the bars
isAnimationActivebooleantrueEnable animation
transitionAnimationOptions{ duration: 0.4, ease: 'easeOut' }Animation timing (motion-v)
Copyright © 2026