Bar chart
Values across categories, side by side, stacked or as shares, upright or lying. The category under the pointer stays bright while the rest step back, and every change of data, range or sort glides from where the bars are.
Examples
Stacked
stack puts the series side by side, stacked, or as shares of their total. A new range, a sort or a hidden series glides from where the bars are, and new data grows out of the loading placeholder.
Synced
Charts in a ChartGroup share the category under the pointer or the focus, by its key.
Horizontal
orientation='horizontal' lays the bars along the categories, here with each value written past its bar and a target line.
Negative values
Bars below zero hang from it, in negativeColor when you give one.
Tracks
track draws each bar’s whole length behind it, for values out of a whole, and label='inside' writes the value at the bar’s end.
Waterfall
A value can be a [from, to] range: waterfall() turns each change into the step it makes from the last, and color picks a colour per bar.
Picking a category
selected, defaultSelected or onSelectedChange lets a press, Enter or Space pick a category, which stays bright until another is picked.
Installation
npx shadcn@latest add https://kinoui.com/r/bar-chart.json- Files
lib/reduce-motion.tslib/scroll.tslib/refs.tslib/resize.tslib/swap.tsxlib/popup.tslib/glide.tsxcomponents/kino/tooltip.tsxlib/cut.tsxlib/announce.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxlib/chart-math.tslib/controllable.tslib/number-format.tslib/chart-core.tsxlib/run-progress.tslib/highlight.tscomponents/kino/chart.tsxlib/placeholder.tscomponents/kino/bar-chart.tsx- Packages
@base-ui/reactclass-variance-authorityd3-array- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
The CLI keeps any of these colours your project already has, such as the chart colours shadcn init writes. To use Kino’s, set them in your global CSS:
:root { --chart-1: oklch(0.62 0.16 250); --chart-2: oklch(0.54 0.18 257); --chart-3: oklch(0.47 0.21 263); --chart-4: oklch(0.4 0.19 268); --chart-5: oklch(0.33 0.15 272);}.dark { --chart-1: oklch(0.82 0.09 245); --chart-2: oklch(0.74 0.13 250); --chart-3: oklch(0.67 0.17 257); --chart-4: oklch(0.61 0.19 263); --chart-5: oklch(0.55 0.2 268);}API reference
BarChart
Bar
Data attributes
CSS variables
Accessibility
- The plot is one stop in the tab order: a slider over the categories. The arrow keys step, Home and End go to the ends, and each category’s values are read as the slider’s value.
- A hidden table holds every value, for screen readers and for copying.
- Loading, an error and new data are announced in a status region.
- With
patterns, each series after the first has a pattern as well as its colour, and forced colours draw each series in a system colour. - When the system asks for less motion, bars and labels move to their place at once and only fade.