Skip to main content

BarChart

Vertical bars — single series, grouped, or stacked.

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When to use​

Vertical bars — single series, grouped, or stacked.

Accessibility​

Each chart ships an accessible fallback (a visually-hidden data table / aria-label summary) so the data is available to screen readers, not just sighted users. Colour is paired with shape/label, never used alone.

Install and import​

npx shadcn@latest add @prism/bar-chart
import { BarChart } from '@/components/prism/BarChart';

In a no-build prototype, read it from the bundle instead: const { BarChart } = window.PrismDesignSystem_39d121;

Examples​

Stacked

<BarChart stacked categories={["Q1","Q2","Q3","Q4"]}
series={[{ name: "New", data: [120,180,150,210] },
{ name: "Returning", data: [90,110,140,160] }]} />

Props​

PropTypeRequiredDescription
categoriesstring[]Yes
seriesBarSeries[]Yes
stackedboolean—
heightnumber—
showGridboolean—
showLegendboolean—
yTicksnumber—
formatY(v: number) =&gt; React.ReactNode—
captionstring—