Krizaka UI
Krizaka UI
ComponentsData display

Line chart

Change over time: one line per series, the last value written at its end, thresholds, markers and a crosshair tooltip.

Web · ✓Mobile · ✓Desktop · ✓BetaCharts
Support level
Beta
Size
Not measured
Who uses it
No live product imports it yet
import { LineChart } from "@krizaka/charts/line";

Web and mobile — the same component for React and React Native. Beta: its API may still change in a minor version.

Why it is here. Its only users were products that left the organisation (2026-10-29): kept until the next major's audit decides.

When to use

  • A trend over time: a creator's earnings per month, credits used per day, latency per hour.
  • Two or three series compared over the same period (this year and last, two plans).
  • A goal or a limit to read against the trend: a payout threshold, an objective, with thresholds.

When not to use

  • Amounts compared across categories that are not time.Use instead: Bar chart
  • A volume whose parts add up to a total over time.Use instead: Area chart
  • A trend in a sentence, a table cell or a stat tile.Use instead: Sparkline

Installation

Install

npm install @krizaka/charts

Import

import { LineChart } from "@krizaka/charts/line";

Examples

Creator earnings

Six months of a creator's earnings and tips in euros, with the payout threshold.

Forecast

The months to come dashed after the actual ones, a marker on a launch.

Live data

A sliding window of jobs per minute, appended as they arrive (useSlidingWindow, live).

Loading, empty, error

The three states at the chart's own height: no layout shift when the data arrives.

Props

Change over time: one line per series, the last value written at its end, a crosshair tooltip, the keyboard.

PropTypeDefaultDescription
datarequiredreadonly T[]—The rows, in the order of the x axis.
actionsMenuboolean—The ⋯ actions menu of the kit. false: the former “Show data” and export buttons, drawn in line. Default true.
autoRangeboolean—Zoom the time axis on the period that has data: the empty days before the first and after the last value are left out (never fewer than minPoints), and a sparse period says so under the chart instead of drawing 13 empty days around one bar. Default false.
brandBrandId—The brand whose palette the charts use. Without it, a chart follows a .brand-<id> ancestor, else Krizaka. Set it when the app loads a brand stylesheet on :root (@krizaka/tokens/brands/sovkora.css).
classNamestring—A class on the figure (layout: margins, grid placement).
curveCurve—The shape between points: monotone (default, never overshoots), linear, step (a value that holds).
dataTableboolean—“View as table” in the actions menu (the table is in the page for screen readers either way). Default true.
descriptionReactNode—A sentence under the title: the period, the unit, the source.
dotsboolean—A dot on every point (short series). Default false: the end of each line carries one.
emptyReactNode—What to show when there is nothing to draw (default: the empty label). An EmptyState of @krizaka /ui fits.
endLabelsbooleantrueWrite the last value at the end of each line (up to three series). Default true.
errorReactNode—The data could not be loaded: true says the default words, a node says yours (a retry button…).
exportableboolean | readonly ExportFormat[]—The downloads of the actions menu: all three by default, or the formats you want, or false for none.
filterableboolean—The legend chips switch the series on and off. Default true.
formatValueFormat—How the values are written (axis, tooltip, table, summary). Default "number".
heightnumber—The height of the plot in pixels. Default 280 (a sparkline: 32).
hideTitleboolean—Visually hide the title (it stays the chart's accessible name): a card that already has its heading.
idstring—The id of the figure.
insightReactNode—One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”.
labelsChartLabelsInput—The words, translated: the buttons, the states, the written summary.
legendboolean—Show the legend (from two series). Default true.
liveboolean—Streaming data (a job queue, an auction): no entrance on updates, no announcement of every new point.
loadingboolean—The data is on its way: a skeleton of the chart, announced once.
localeLocale—The locale of every figure and date ("fr-FR"). Default "en-US".
markersreadonly Marker[]—Vertical markers at a category: a launch, an incident.
minPointsnumber—With autoRange, the fewest categories to keep so a short burst still has a time scale. Default 7.
onSelect((datum: T, index: number) => void)—Called with the row when a point or a bar is clicked (or Enter is pressed on it).
seriesreadonly SeriesSpec<T>[]—The series to draw, each with its field and its name; the palette follows their order.
styleCSSProperties—Inline style on the figure (layout only: colours come from the tokens).
summary"hidden" | "visible"—The written summary: read by screen readers only ("hidden", default), or shown under the chart ("visible").
summaryTextstring—Your own summary instead of the generated one (still read first by screen readers).
thresholdsreadonly Threshold[]—Horizontal lines at a value: a goal, a payout threshold.
titlestring—What the chart shows, in a few words: its accessible name, and its heading unless hideTitle. Inside a ChartCard, the card's title is the default.
xstring | ((datum: T, index: number) => unknown)—The field (or function) of the category: a month ("2026-04"), a day, a label. Default: the row's position.
xFormatCategoryFormat—How the categories are written. Default: dates by their precision (2026-04 → Apr 2026), text as is.
xLabelstring—The header of the categories in the data table (Month).
ystring | ((datum: T, index: number) => number | null)—A single series: its field. Use series for several.
yLabelstring—The name of the single y series (legend, tooltip, table). Default: the field's name.
zeroboolean—Start the value axis at zero. Default: true for bars and areas; for lines, unless the values sit far from zero.

Accessibility

  • The plot is a group named by the title and described by a summary written from the data (extremes, trend), read before anything else.
  • The data table is always in the page for assistive technology; “Show data” reveals it for everyone.
  • Colour never carries a meaning alone: a legend from two series, direct labels, the table.
  • The entrance plays once, when the chart comes on screen, and never under reduced motion.

Keyboard

KeysAction
TabMoves the focus to the plot (one tab stop), then to the data and export buttons.
Arrow keysWalk the points one by one: each is announced and its tooltip shown.
Home / EndJump to the first or the last point.
EscHides the tooltip and clears the active point.
EnterSelects the active point (calls onSelect with its row).

Best practices

  • Give dates as ISO strings (2026-04, 2026-04-12): the axis writes them in the reader's locale, by their precision.
  • Store money as integer minor units and say so with format={{ style: "money", currency }}: the axis goes compact, the tooltip exact.
  • Keep to three series or fewer; past that, split into small multiples or fold the rest into one series.
  • Dash a forecast or a previous period (dashed), never a different colour for the same measure.
  • Write the title as what the chart answers (“Earnings, last 6 months”): it is the accessible name.

Generated from the code of @krizaka/ui 5.3.4: its meta.ts, its examples and its types.Edit this documentation on GitHub

On this page