Skip to contentKino
Skip to Content

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.

npx shadcn add https://kinoui.com/r/line-chart.json
Share on

Examples

People writing

Everyone in the Kino team who wrote a note, by where they wrote it.
Yesterday821
CategoryWebiOSAndroid
Fri 16 October459317156
Sat 17 October30716886
Sun 18 October35919884
Mon 19 October629316162
Tue 20 October544262133
Wed 21 October489289136
Thu 22 October576291137
Fri 23 October604290136
Sat 24 October39223794
Sun 25 October37818595
Mon 26 October585348162
Tue 27 October598296162
Wed 28 October544293160
Thu 29 October677284187
Fri 30 October653349142
Sat 31 October368207113
Sun 1 November409247127
Mon 2 November687359179
Tue 3 November632378180
Wed 4 November589347181
Thu 5 November592309163
Fri 6 November598372154
Sat 7 November496275120
Sun 8 November485274138
Mon 9 November585385159
Tue 10 November720389159
Wed 11 November752364206
Thu 12 November712397204
Fri 13 November698371187
Sat 14 November453252116

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.

Notes written

The first two weeks of November.
CategoryNotes written
Sun 1 November153
Mon 2 November331
Tue 3 November343
Wed 4 November368
Thu 5 November362
Fri 6 November298
Sat 7 November113
Sun 8 November125
Mon 9 November332
Tue 10 November264
Wed 11 November269
Thu 12 November284
Fri 13 November368
Sat 14 November155

Photos added

The first two weeks of November.
CategoryPhotos added
Sun 1 November70
Mon 2 November111
Tue 3 November108
Wed 4 November116
Thu 5 November100
Fri 6 November130
Sat 7 November67
Sun 8 November61
Mon 9 November90
Tue 10 November104
Wed 11 November95
Thu 12 November115
Fri 13 November129
Sat 14 November53

Synced

Charts in a ChartGroup share the day under the pointer or the focus, by its key.

Notes this quarter

Written so far, and where the last month’s pace ends the quarter.
CategoryNotes
Week of Mon 5 October470
Week of Mon 12 October880
Week of Mon 19 October1,379
Week of Mon 26 October1,896
Week of Mon 2 November2,426
Week of Mon 9 November2,914
Week of Mon 16 November3,430
Week of Mon 23 November3,980
Week of Mon 30 November4,562
Week of Mon 7 December5,129
Week of Mon 14 December5,770
Week of Mon 21 December6,426
Week of Mon 28 December7,026

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.

Sync time

How long a note takes to reach every device, yesterday. Four hours of logs were lost.
CategoryMedian95th percentile
00:00190 ms375 ms
01:00199 ms322 ms
02:00212 ms395 ms
03:00200 ms329 ms
04:00182 ms365 ms
05:00No valueNo value
06:00No valueNo value
07:00208 ms391 ms
08:00208 ms361 ms
09:00223 ms468 ms
10:00248 ms411 ms
11:00247 ms449 ms
12:00231 ms447 ms
13:00225 ms434 ms
14:00No valueNo value
15:00No valueNo value
16:00230 ms466 ms
17:00234 ms391 ms
18:00183 ms377 ms
19:00184 ms373 ms
20:00214 ms396 ms
21:00215 ms332 ms
22:00200 ms351 ms
23:00217 ms332 ms

Gaps

A missing value breaks the line, and connectNulls bridges it with a dashed line. zero={false} fits the value axis to the data.

Credits balance

Kino AI credits left at the start of each month, in steps.
CategoryBalance
January 20261,200
February 2026640
March 2026-380
April 2026-920
May 2026-260
June 2026480
July 20261,340
August 20262,100

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

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:

globals.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

PropTypeDefaultDescription
dataChartDatum[]NoneOne row per category: the category under index, and a value under each series’ key. A missing value leaves a gap.
indexstringNoneThe key of each row’s category.
configChartConfigNoneEach series by its key: its label and color (or theme for light and dark). shadcn’s chart config works as it is.
labelstringNoneWhat the chart shows, for screen readers, such as “Visitors by month”.
descriptionstringNoneA longer account for screen readers, such as the trend.
formatIntl.NumberFormatOptions(value: number) => stringNoneHow values are written in the tooltip, the labels, the table and, shortened, the value axis.
categoryFormat(value: unknown) => stringStringHow a category is written.
localeIntl.LocalesArgumentNoneThe locale numbers are written in. Give one, so the server and the browser agree.
orderedbooleanfalseThe categories run in order, such as days, so the tooltip gives each value’s change since the one before.
domain[number | 'auto', number | 'auto']['auto', 'auto']The ends of the value axis; auto fits the data and rounds out to a tick.
tickCountnumber5About how many ticks the value axis marks; fewer when the axis is short.
tickValuesnumber[]NoneThe ticks to mark, in place of round ones.
allowDecimalsbooleanNoneTicks between whole numbers; off when every value is whole.
hiddenSeriesstring[]NoneThe series hidden, with defaultHiddenSeries and onHiddenSeriesChange.
activeIndexnumber | nullNoneThe category under the pointer or the focus, with defaultActiveIndex and onActiveIndexChange.
selectedstring | nullNoneThe category picked, by its key, with defaultSelected and onSelectedChange. Giving any of them lets a press pick one.
loadingbooleanfalseShows a placeholder; the marks grow out of it when the data arrives.
errorReactNodeNonetrue for the chart’s own words, or what to say.
onRetry() => voidNoneAdds a Try again button beside the error.
emptyReactNodeNoneWhat shows when data is empty.
messagesPartial<ChartMessages>NoneEvery word the chart says or reads out, for another language.
zerobooleantrueKeeps zero on the value axis, so a rise and a fall read in proportion. Off fits the axis to the data.
entrance'none''rise''draw''none'How the lines arrive the first time the chart comes into view: rising from zero, or drawn along from the start. None by default, since a page that loads doesn’t animate into place.

Line

PropTypeDefaultDescription
dataKeystringNoneThe key of the series’ values in the data and in the config.
curve'monotone''linear''step''monotone'A smooth curve that never overshoots its points, straight lines, or steps.
dotsboolean'last'falseMarks every point with a dot, not only the lit one; last marks only the last value, with a solid dot.
dashedbooleanfalseDraws the whole line dashed, such as a target or last year.
forecastFromstringNoneThe key of the first category that is a forecast. The line is dashed from the one before it.
connectNullsbooleanfalseBridges each gap a missing value leaves with a dashed line, in place of a break.

Data attributes

AttributeOnDescription
data-dimA line and its dotsIt steps back while another day or series is brought forward.

CSS variables

VariableSet it onDefaultDescription
--line-chart-widthLineChart, or anything above it2pxHow thick the lines are.
--line-chart-dimLineChart, or anything above it0.3How much colour a line that steps back keeps. It keeps its lightness, so it keeps its contrast.
--line-chart-window-fadeLineChart, or anything above it1.5remHow far the bright stretch around the lit day fades into the line that stepped back.

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.