Simulates prefers-reduced-motion for the demo. Off follows your system setting.
Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.
1
| quarter | Web | Mobile |
|---|---|---|
| Q1 | 320 | 210 |
| Q2 | 410 | 290 |
| Q3 | 380 | 350 |
| Q4 | 520 | 430 |
A bar chart with soft rounded ends, grouped when there are several series.
npx shadcn@latest add ikislay/pixel-ui/bar-chartimport { BarChart } from "@/components/ui/bar-chart"const data = [{ quarter: "Q1", web: 320, mobile: 210 },{ quarter: "Q2", web: 410, mobile: 290 },{ quarter: "Q3", web: 380, mobile: 350 },]export function Demo() {return (<BarChartlabel="Signups by quarter"data={data}index="quarter"series={[
1// Loading…
Options you can pass to customize this component.
data*Record<string, string | number>[]One object per point along the x axis.
index*stringThe key in each object that labels the x axis.
series*{ key: string; label?: string; color?: string }[]The keys to plot. Colors follow the chart palette in order unless you set one.
label*stringNames the chart for screen readers and captions its data table.
heightnumberHeight in pixels. The width fills the parent.
format(value: number) => stringFormats values wherever the chart shows them. Defaults to short numbers like 12.4K.
radiusnumberCorner radius at the value end of each bar. It shrinks to fit thin or short bars.
classNamestringMerged onto the root element.