Area chart
Values over time as filled areas, overlapping, stacked or as shares, or as a band between two values. The day under the pointer stays bright while the rest steps back, and a new range grows out of the areas that were there.
Examples
Layouts
Areas overlap, stack or stack as shares with stack, and a new range, layout or hidden series moves each area from where it is. The day under the pointer stays bright while the rest steps back.
Synced
Charts in a ChartGroup share the day under the pointer or the focus, by its key.
Single
One area with a reference line, its fill fading from its peak.
Band
A value given as [from, to] draws a band between the two, and both ends are marked while lit.
Below zero
Below zero, the area fills up to the zero line.
Installation
npx shadcn@latest add https://kinoui.com/r/area-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/line-path.tslib/area-fill.tsxlib/placeholder.tslib/chart-line.tsxcomponents/kino/area-chart.tsx- Packages
@base-ui/reactclass-variance-authorityd3-arrayd3-shape- 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
AreaChart
Area
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.
- Each area has its line along its top, so overlapping areas read apart where their fills meet. Forced colours draw each series in a system colour.
- When the system asks for less motion, areas move to their place at once and only fade.