Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Bar Chart

Pro

Bars that grow in with a stagger and show values on hover or focus.

Installation

pnpm dlx shadcn@latest add @viewport/bar-chart

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
data*Datum[]—
title*string

Accessible title for the chart.

—
format(value: number) => string

Formats values for the tooltip and the data table.

(v) => v.toLocaleString("en-US")
heightnumber

Chart height in pixels.

200
classNamestring—

Accessibility

  • The same data is provided as a visually hidden table.
  • Each bar is focusable and shows its value.
  • Bars appear at full height under reduced motion.