Chart
chartThe 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.
import { ChartLegend, ChartTooltip } from "@/components/forme/chart/chart";
const series = [
{ label: "Desktop", value: "5,310", color: "var(--chart-1)" },
{ label: "Mobile", value: "3,710", color: "var(--chart-2)" },
{ label: "Tablet", value: "940", color: "var(--chart-3)" },
];
export function ChartDemo() {
return (
<div className="flex flex-col items-center gap-5">
<div className="flex flex-wrap items-start justify-center gap-4">
<ChartTooltip title="Aug 18" rows={series} />
<ChartTooltip title="Aug 18" indicator="line" rows={series.slice(0, 2)} />
</div>
<ChartLegend items={series} />
</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.
ChartTooltip
The tooltip every Forme chart renders: a floating panel with a heading, then one row per series with its colour, its name and its value right-aligned in tabular figures so a column of numbers lines up.
| Prop | Type | Default | Description |
|---|---|---|---|
rows* | readonly ChartTooltipRow[] | — | |
title | string | — | |
indicator | "dot" | "line" | "dot" | dot for bars and areas, line for lines, matching what the series looks like. |
ChartLegend
A row of swatches naming each series, in the order its colours were assigned.
| Prop | Type | Default | Description |
|---|---|---|---|
items* | readonly { label: string; color: string }[] | — | |
indicator | "dot" | "line" | "dot" | |
className | string | — |
Related


Composed Chart
Columns and a line on one axis, on TanStack Charts: volume against its target, actuals against the plan. Rounded columns side by side, the line drawn over them, and a band cursor that lists every series in the column.
data display

Heatmap Chart
A grid of cells whose colour carries a quantity, on TanStack Charts: activity by weekday and hour, scores by team and quarter. Six steps of one hue from the sunken surface to the chart accent, optional values in the cells, and a tooltip on every cell.
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