Bar Chart
bar-chartA single or grouped column chart in plain SVG. Columns are capped at 24px with rounded tops and 2px gaps, the hovered category lifts while the rest recede, arrow keys read each category, and a hidden table carries every value.
import { BarChart } from "@/components/forme/bar-chart/bar-chart";
const deploys = [
{ day: "Mon", production: 42, preview: 118 },
{ day: "Tue", production: 51, preview: 136 },
{ day: "Wed", production: 38, preview: 102 },
{ day: "Thu", production: 64, preview: 151 },
{ day: "Fri", production: 57, preview: 129 },
{ day: "Sat", production: 12, preview: 34 },
{ day: "Sun", production: 9, preview: 27 },
];
const revenue = [
{ quarter: "Q1", revenue: 182000 },
{ quarter: "Q2", revenue: 214000 },
{ quarter: "Q3", revenue: 267000 },
{ quarter: "Q4", revenue: 301000 },
];
const compact = new Intl.NumberFormat("en-US", {
style: "currency",
currency: "USD",
notation: "compact",
});
export function BarChartDemo() {
return (
<div className="grid w-full gap-4 md:grid-cols-[minmax(0,1.6fr)_minmax(0,1fr)]">
<div className="rounded-xl border border-border bg-card p-5 shadow-xs">
<p className="text-title-2-semibold">Deploys this week</p>
<BarChart
className="mt-4"
label="Production and preview deploys per day this week"
data={deploys}
index="day"
series={[
{ key: "production", label: "Production" },
{ key: "preview", label: "Preview" },
]}
/>
</div>
<div className="rounded-xl border border-border bg-card p-5 shadow-xs">
<p className="text-title-2-semibold">Revenue by quarter</p>
<BarChart
className="mt-4"
label="Revenue by quarter, 2026"
data={revenue}
index="quarter"
series={[{ key: "revenue", label: "Revenue" }]}
formatValue={(value) => compact.format(value)}
/>
</div>
</div>
);
}Install
Adds the component, its registry dependencies, and the token stylesheet you import once.
API reference
Read from the source, so it is the API of the file you install. A prop marked * is required.
BarChart
A column chart, single or grouped, in plain SVG.
| Prop | Type | Default | Description |
|---|---|---|---|
data* | readonly Row[] | — | |
index* | keyof Row & string | — | The field that names each category. |
series* | readonly BarSeries<Row>[] | — | One series is a plain column chart; more are grouped side by side. |
label* | string | — | |
height | number | 240 | |
formatValue | (value: number) => string | (value) => value.toLocaleString("en-US") | |
className | string | — |
Related


Area Chart
A line or area chart in plain SVG with no chart library. A crosshair snaps to the nearest point and lists every series, arrow keys walk it, round tick values, a legend from two series up, and a hidden table so screen readers get the numbers.
data display

Histogram Chart
How a set of measurements is distributed, on TanStack Charts. Bins are computed with round edges, the tooltip names each range and its count, and dashed markers put a median or p95 right on the shape.
data display

Chart
The tooltip and legend every Forme chart shares: a floating panel with a colour, a name and a right-aligned value per series, and a row of swatches. Installed with any chart; use them directly to give a chart of your own the same finish.
data display