Line chart
Values over time as lines, smooth, straight or in steps, with gaps where data is missing and a dashed forecast. The day under the pointer stays bright while the rest steps back, and a new range grows out of the line that was there.
Examples
Ranges
A new range grows out of the line that was there, and a new curve or a hidden series glides from where the lines are. 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.
Forecast
forecastFrom dashes the line from the day before it on, and the tooltip and the table say which values are forecast. dots marks every point.
Gaps
A missing value breaks the line, and connectNulls bridges it with a dashed line. zero={false} fits the value axis to the data.
Steps
curve='step' holds each value until the next, for a balance or a price that changes at a moment.
Installation
npx shadcn@latest add https://kinoui.com/r/line-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/line-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
LineChart
Line
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, with any forecast named, are read as the slider’s value.
- A hidden table holds every value, for screen readers and for copying, and says which are forecast.
- Loading, an error and new data are announced in a status region.
- A forecast and a bridged gap are dashed, so they read apart from measured values without colour. Forced colours draw each series in a system colour.
- When the system asks for less motion, lines move to their place at once and only fade.