Line chart
One metric over a period as a smooth line, with the value of the hovered point.
Orders
Oct 26 – Nov 1, 2026 · vs previous period
Installation
npm i @uisatin/uiimport { LineCard } from '@uisatin/ui/line-chart'About 50.8 kB of JavaScript, minified and gzipped, with what it imports (React aside). The stylesheet is one file for every component.
npx shadcn@latest add https://uisatin.dev/r/line-chart.jsonAdds line-chart.tsx, badge.tsx, bar-chart.tsx, chart.tsx, dropdown.tsx, floating.tsx, form-field.tsx, kbd.tsx, labels.tsx, pointer-modality.tsx and select.tsx to components/ui.
First time with Satin? Set it up once, styles and fonts included, with the installation guide.
API Reference
The LineCard component is a wrapper around the div element with the title and a period Select, the KPI with its change and the range, then the line. Arrow keys move along the points once the plot has focus. smoothPath(points) from @uisatin/ui/line-chart returns the monotone curve the line is drawn with, as an SVG path, for custom charts and sparklines.
| Prop | Type | Default |
|---|---|---|
title | string | — |
range | string | — |
data | ChartDatum[] | — |
total | string | — |
change | string | — |
periods | string[]string[][] | — |
value | string | — |
onPeriodChange | (period) => void | — |
unit | string | — |
area | boolean | false |
labelEvery | number | — |
formatValue | (value) => string | — |
reducedMotion | boolean | — |
highlight | number | — |
Accessibility
The card is role="figure" labelled by its title. The plot is one tab stop, a role="group" named "title, 12 points" (chartPoints in SatinLabels). Focusing it picks the last point, and a polite live region reads the picked point as "label: value". The line and axes are hidden.
| Key | Action |
|---|---|
| Tab | Focuses the plot and picks the last point. |
| ←or→ | Picks the previous or next point; stops at the ends. |
Something wrong or missing on this page?
Report a problemSuggest an improvement