Bar Chart
FREEGrouped or stacked bars that grow in; the hovered column is highlighted.
Installation
Terminal
npx @bloxa/cli add bar-chart
# or: npx shadcn@latest add @bloxa/bar-chartPackages installed automatically: motion
Examples
Grouped and stacked
API reference
Every component also accepts the props of the element it renders.
BarChart
| Prop | Type | Default | Description |
|---|---|---|---|
| data | object[] | — | Rows. |
| index | string | — | Key for x-axis labels. |
| categories | string[] | — | Numeric series keys to draw. |
| labels | Record<string, string> | — | Display names for series. |
| colors | string[] | — | Series colors; the first is the theme accent. |
| valueFormatter | (value) => string | — | Value format; defaults to localized numbers. |
| height | number | 260 | Height in px; width follows the container. |
| showLegend / showGrid / showXAxis / showYAxis / showTooltip | boolean | true | Toggle parts. |
| stacked | boolean | false | Stack. |