Hand-built SVG charts, no chart library: ColumnChart, BarList (clipped scale), LineChart with status markers, ChartTable, ChartCard with chart/table toggle, ViewSwitch. Keyboard readable; every mark opens its records.
Click a figure: what it would open shows here.
$ npx shadcn@latest add @highcommand/chart-kitCopies the source into your project and pulls in what it needs (4 other items). First time? Add the registry to components.json.
Columns over time (or any ordered categories), single, stacked or grouped.
datarequiredDatum[]—One column (or group) per item, in order.
seriesrequiredSeriesDef[]—The measures; each one is a segment of a stack, or a column of a group.
unitrequired'pct' | 'count' | 'money'—How the axis and tooltips format values.
labelrequiredstring—The chart's accessible name.
stackedbooleantrueStack the series in one column (default true); false draws them side by side.
heightnumber200Chart height in px (default 200).
onSelectChartSelect—A column (or its segment) was activated.
<BarList />10 propsRanked horizontal bars (categories down the side, or above each bar with `labels="above"` so long names show in full), single or stacked; the value at the bar's end.datarequiredDatum[]—One row per item, in the order given (rank them first).
seriesrequiredSeriesDef[]—One series is a single bar; two or more are stacked.
unitrequired'pct' | 'count' | 'money'—How the value text and tooltips format values.
labelrequiredstring—The chart's accessible name.
maxnumber12Rows shown before the "All n" button (default 12).
valueText(d: Datum) => string—the text at the end of a row (default: the single series' text, or the stack's total)
statusOf(d: Datum) => StatusColor | undefined—a single-series bar that is a status (a negative margin): its status colour
labels'side' | 'above''side'where the category names go: beside the bars (truncated to fit, full name on hover) or above each bar, in full
capnumber—clip the value scale at this value (single series only)
onSelectChartSelect—a bar was activated
<LineChart />9 propsOne measure over ordered periods: a 2 px neutral line; each point's marker takes a status colour when the point is a status.datarequiredDatum[]—One point per item, in order (oldest first).
seriesrequiredSeriesDef—The one measure drawn; its key picks each datum's value.
unitrequired'pct' | 'count' | 'money'—How the axis and tooltips format values.
labelrequiredstring—The chart's accessible name.
heightnumber200Chart height in px (default 200).
domain[number, number]—The axis range as [min, max]; default runs from 0 (or the lowest value below it) to the highest value.
statusOf(v: number) => StatusColor | undefined—A status colour for a point's marker, from its value (none: neutral).
zeroboolean—draw the zero line (a margin can go below it)
onSelectChartSelect—a point was activated
<ChartTable />5 propsThe same numbers as a table, every value opening its records (the accessible and print view of every chart).datarequiredDatum[]—One row per item, one column per series.
seriesrequiredSeriesDef[]—The columns.
captionrequiredstring—The table's caption, read by assistive technology only.
noteHeaderstring—Adds a last column with this heading, showing each item's `note`.
onSelectChartSelect—a value was activated
<ChartCard />11 propsA chart widget's card: title and qualifier, optional view switch, a chart/table toggle, then the chart, a loading state, an error or an empty state.titlerequiredstring—The card's heading; also names the chart/table toggle.
testidrequiredstring—`data-testid` of the card; the toggle's is `<testid>-toggle`.
childrenrequired(view: 'chart' | 'table') => ReactNode—Draws the chart for the current view: "chart" or "table".
qualifierReactNode—A quiet line after the title (period, basis).
controlsReactNode—Your controls (a `ViewSwitch`) before the chart/table toggle.
loadingboolean—Shows a loading state instead of the chart.
errorError | null—Shows an error state with the error's message instead of the chart.
onRetry() => void—Called when the person presses Retry in the error state.
emptyboolean—Shows the empty state instead of the chart.
emptyTextstring—The empty state's text (default "No data in this period").
classNamestring—Extra class on the card.
<ViewSwitch />4 propsA small segmented switch for a chart's view (By type / By week).valuerequiredT—The selected option's value.
optionsrequired{ value: T; label: string }[]—The choices, in order.
onChangerequired(v: T) => void—Called with the chosen option's value.
labelrequiredstring—The switch's accessible name.
fromApi(c: ChartData, noteOf?: ((p: { key: string; label: string; from?: string | undefined; to?: string | undefined; values: Record<string, SourcedValue>; base?: SourcedValue | undefined; }) => string | undefined) | undefined…An API chart as chart data: numbers from the SourcedValues, each cell opening its records.
niceTicks(lo: number, hi: number, count?: number, integer?: boolean): number[]Round tick values from `lo` to `hi` (about `count` steps of 1, 2, 2.5 or 5 times a power of ten), covering both ends. `integer`: whole steps only, for axes whose labels round to whole numbers (fmtTick), so 0–2 reads 0, 1, 2 rather than 0, 1, 1, 2, 2.
paintOf(series: SeriesDef[]): Record<string, string>The fill class of each series: a step of the one-hue ramp for an ordered bucket, its status colour and pattern for a status, else a grey; a grey series next to a neutral status series is hatched. Status fills carry a texture as well as a colour (at risk stripes, late cross-hatch, blocked dots; StatusPatterns), so they stay apart for colour-blind readers and in print.
barPath(x: number, y: number, w: number, h: number, dir: "up" | "right" | "none"): stringA bar with a 4 px rounded data end and a square end at the baseline. `dir` is where the data end points.
markPath(status: StatusColor | undefined, x: number, y: number, r: number): stringA point marker in its status's shape (on track circle, at risk triangle, late diamond, blocked square), centred on (x, y).
fmtTick(v: number, unit: "money" | "pct" | "count"): stringAn axis label: whole percent, a grouped count, or short dollars ($750, $1.5k, $12.5k, $1.25M) with up to two decimals so a 2.5-step tick keeps its value; the unit is picked after rounding ($999.60 is $1k, $999,999 is $1M).
fmtValue(n: number | null, unit: "money" | "pct" | "count"): stringA value as a chart prints it in its tooltip and table: money (dollars in) through fmtMoney's compact form, the app's one money rule.
Install this free piece now; the Pro pieces drop in on top of it, in the same app. Pro is $79 once.