Skip to content

Animated React Charts

Animated React charts with tooltips, keyboard reading and a table view for every one.

Files to copy

14 folders · 22 files · 4 packages
From theme/src/
  • components/charts/
  • components/button/
  • components/drawer/parts/sheet.tsx
  • components/kbd/
  • components/menu/
  • components/number-ticker/
  • components/segmented/
  • components/skeleton/
  • components/spinner/
  • components/status-icons/
  • hooks/{use-controllable.ts, use-direction.ts, use-intersection.ts, use-latest.ts, use-magnetic.ts, use-media-query.ts, use-preferences.ts, use-resolved-scheme.ts}
  • motion/{gate.ts, tokens.ts}
  • lib/{canvas-effects.ts, cn.ts, csv.ts, form.ts, glide-highlight.tsx, heading.ts, math.ts, popup-a11y.ts, popup-motion.ts, state-light.tsx, warn-once.ts}
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/bar-chart.jsonRegistry items: bar-chart, bar-list, beeswarm, box-plot, bullet-chart, bump-chart, candlestick-chart, chart-table-twins, chord-diagram, cohort-chart, combo-chart, diverging-bar-chart, dumbbell-chart, error-bar-chart, funnel-chart, gantt-chart, gauge-chart, geo-map, line-chart, lollipop-chart, marimekko-chart, network-graph, pie-chart, polar-area-chart, population-pyramid, radar-chart, radial-bar-chart, radial-progress, ridgeline-chart, sankey-chart, scatter-chart, sparkbar, sparkline, stacked-area-chart, step-line-chart, streaming-chart, sunburst-chart, tracker-chart, treemap, waffle-chart, waterfall-chart. The command installs the first; swap the name in the URL for any other. The styles need the Tailwind v4 glass UI setup.
The examples also use
  • components/glass-card/
  • motion/light-follower.ts
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/button.json https://lokendra-builds.github.io/sheenui/r/donut-chart.json https://lokendra-builds.github.io/sheenui/r/glass-card.json https://lokendra-builds.github.io/sheenui/r/line-chart.json https://lokendra-builds.github.io/sheenui/r/radial-progress.json https://lokendra-builds.github.io/sheenui/r/sparkline.json
Packages
pnpm add @base-ui/react clsx motion tailwind-merge

Next.js: samples here pass functions (formatters, seriesLegend, a dashboard's load), so put them in a file that starts with "use client".

52 live previews of the 48 chart components: some charts appear more than once, as variants. Each one is the real component with its own data, loaded as you scroll. Open one for its docs, props and keyboard map.

Showing 12 of 52 chart previews

Featured

Hover or arrow-key through any chart and the others follow. Drag the brush to zoom all of them, click a legend key to hide a series, and every number re-counts for the days you picked.

Revenue, 42 days

$513.7K +27.4% versus the previous period

Orders

11,004 +32.3% versus the previous period

Average order

$47 −3.7% versus the previous period

Conversion

2.6%

Revenue by channel

Aug 21 – Oct 1, daily, US dollars

  • Organic
  • Paid
  • Previous period

Orders

  • Orders
  • Previous period

Conversion rate

Channel mix

Share of revenue

Use arrow keys to read each slice.
$513.7KRevenue

Visitors right now

A new reading every 2 s; pauses off-screen and in hidden tabs.

934on the site

About charts

Frequently asked questions

Line, area, bar and donut

The everyday charts, documented here. Smooth curves, gradient fills, draw-in and grow-from-baseline entrances, previous-period comparison, clickable legends, annotations, a brush, synced crosshairs and PNG / SVG / CSV export. As a shadcn charts alternative, each chart has a table view.

Line chart

Click a legend key to hide a series (the axis re-fits); hover one to dim the others. The dashed line is the previous period. Download it from the card's menu.

Monthly revenue by channel

In US dollars, with last year dashed

  • Organic
  • Paid
  • Referral
  • Previous period

Area chart with a brush

A gradient wash that fades to transparent. The brush under a long series zooms it: drag the window, drag its edges, or use the arrow keys on them.

Visits

Daily, last 120 days

14.8K

Bar chart

Bars grow from the baseline. The dashed tick on each Signups bar is last year's value.

Signups vs activations

  • Signups
  • Activated
  • Signups, previous period

Stacked bars

Horizontal bars

Best for long category names. Values sit at the tip of each bar.

Donut chart

Part-to-whole at a glance, at most 6 slices. Hover a slice to read it in the center; click a legend key to leave a slice out (the ring re-flows and the total re-counts).

Radial progress & gauge

A single ratio against a limit; the number rolls with the arc. With coloring="severity" the color turns warning and critical, always with a status word too.

Sparklines in stat tiles

A small trend under a headline number; it draws in when the tile scrolls into view and the latest point gets a dot.

Chart-wide features

The same building blocks power every chart above and the dashboards: synced crosshairs, annotations, export, live data and i18n.

Synced crosshairs

Charts inside one ChartSyncProvider share the point being read, matched by x value: hover the line and the bars follow (and the other way round).

Annotations

Reference lines and bands on the value axis, event markers and ranges on the x axis. Labels sit on a surface plate, in text colors; events are also read out with their data point.

Export, locale and labels

exportable adds a download menu: PNG and SVG keep the exact colors of the current theme, CSV has the raw numbers. Every string is a label, and numbers follow the locale (German here).

Live data

useLiveData appends a row on an interval into a sliding window and pauses off-screen, in hidden tabs and on Pause. With live, new points slide in from the right instead of morphing.

API

Series take a color slot from 1 to 8 (the validated palette, assigned in order when omitted, never re-ranked when a series is hidden). Every chart needs an aria-label; pair it with a ChartTable so every value can be read without color.

Show the prop tables for every chart, card and helper

LineChart / AreaChart

PropTypeDefaultDescription
data (required)readonly ChartRow[]NoneOne object per point: the index key plus one number per series key, e.g. { month: "Jan", visits: 4200 }.
index (required)stringNoneKey of the x-axis value in each row (e.g. "month").
series (required)readonly CompareSeries[]NoneThe lines. color is a palette slot 1–8. Give a series a compareKey to draw its previous period from that key of each row as a dashed, muted line.
areabooleanfalseFill the area under each line with a gradient that fades to transparent.
heightnumber260Height of the chart in px; the width follows the container.
format((n: number) => string)NoneFormat values in the tooltip, labels and on the axis. Without it, values use formatCompact (or the locale's compact format) and axis ticks get exactly as many decimals as their step needs.
localestringNoneLocale for the default number format (e.g. "de").
endLabelsbooleantrueLabel the end of each line (only when labels don't collide; the legend always carries identity).
emptyStateReactNodeNoneShown when there is nothing to plot.
curveChartCurve"monotone""monotone" (default): smooth curves that never overshoot a value. "linear": straight segments.
gradientbooleantrueArea fill fades from the line to transparent (default). false: a flat soft wash.
zerobooleantrueKeep zero on the value axis (default). false fits the axis to the data, for values that live far from zero (rates, prices, temperatures). Areas then fill to the bottom of the plot.
glowbooleantrueSoft glow on the active line and point in dark mode.
patternsbooleantrue when series.length > 3Tell series apart without colour: each series gets its own marker shape (circle, square, triangle, diamond).
hiddenSeriesreadonly string[]NoneSeries keys to hide (controlled). Inside a ChartCard the card's legend controls this.
highlightedSeriesstring | nullNoneSeries key to emphasise (the others dim). Inside a ChartCard, legend hover controls this.
annotationsreadonly ChartAnnotation[][]Reference lines and bands, event markers and ranges.
brushboolean | LineChartBrushNoneA range selector under the chart for long series (drag, keyboard, touch).
syncbooleantrueInside a ChartSyncProvider: share the crosshair with the other charts.
liveboolean | { duration?: number; }off; an object's duration defaults to 0.6 inside the slide hookStreaming data: when the rows slide by (oldest out, newest in), the lines slide left instead of morphing. Pair with useLiveData(). duration = seconds per slide (default 0.6).
tooltipSurfaceTooltipSurface"glass"Tooltip surface: "glass" (default) or "opaque" for busy charts.
labelsPartial<LineChartLabels>defaultLineChartLabelsThe chart's built-in strings (empty state, table text); a partial object over the English defaults, so pass only the keys you translate. Every other string, for translation: labels={{ instructions: "…" }}; omitted keys keep the English of defaultLineChartLabels. All 3 keys of LineChartLabels are listed in the key table under the props table.
aria-label (required)stringNoneAccessible summary of what the chart shows.
classNamestringNoneAdds extra classes to the outer element.
LineChartLabels keys and English defaults (3)
Pass any key in labels; the rest keep the defaults of defaultLineChartLabels.
KeyEnglish default
instructionsUse left and right arrow keys to read values.
previous(label) => `${label} (previous)`
brushnested object: takes the keys of ChartBrushLabels; empty here, so its own English defaults apply

BarChart

PropTypeDefaultDescription
data (required)readonly ChartRow[]NoneOne object per category: the index key plus one number per series key, e.g. { day: "Mon", orders: 12 }.
index (required)stringNoneKey of each row that names its category (the axis label), e.g. "day".
series (required)readonly CompareSeries[]NoneThe bars. Give a series a compareKey to mark its previous period on each bar (unstacked).
layout"horizontal" | "vertical""vertical""vertical" = columns rising from the x-axis; "horizontal" = bars from the left (best for long category names).
stackedbooleanfalseStack series on top of each other instead of side by side. Negative values stack downwards from zero (a diverging stack).
showValuesbooleanfalsePrint the value at the end of each bar (single, unstacked series only).
heightnumber260 for columnsChart height in px, axes and labels included.
format((n: number) => string)NoneFormat values in the tooltip and labels, and on the axis (the default axis format follows the tick step).
localestringNoneLocale for the default number format (e.g. "de").
emptyStateReactNodeNoneShown when there is nothing to plot.
patternsbooleantrue when series.length > 3Tell series apart without colour (hatch fills).
gradientbooleantrueA soft sheen down each bar (strongest at the value end).
glowbooleantrueSoft glow on the bars being read, in dark mode.
hiddenSeriesreadonly string[]NoneSeries keys to hide (controlled). Inside a ChartCard the card's legend controls this.
highlightedSeriesstring | nullNoneSeries key to emphasise (the others dim). Inside a ChartCard, legend hover controls this.
annotationsreadonly ChartAnnotation[][]Reference lines / bands on the value axis, event markers and ranges on the categories.
syncbooleantrueInside a ChartSyncProvider: share the active category with the other charts.
tooltipSurfaceTooltipSurface"glass"Tooltip surface style: "glass" (default) or "opaque" for busy charts.
labelsPartial<BarChartLabels>defaultBarChartLabelsThe chart's built-in strings (empty state, table text); a partial object over the English defaults, so pass only the keys you translate. Every other string, for translation: labels={{ instructions: "…" }}; omitted keys keep the English of defaultBarChartLabels. All 3 keys of BarChartLabels are listed in the key table under the props table.
aria-label (required)stringNoneNames the chart for assistive tech (required): say what is plotted, e.g. "Orders per day".
classNamestringNoneAdds extra classes to the outer element.
BarChartLabels keys and English defaults (3)
Pass any key in labels; the rest keep the defaults of defaultBarChartLabels.
KeyEnglish default
instructionsUse arrow keys to read values.
totalTotal
previous(label) => `${label} (previous)`

DonutChart

PropTypeDefaultDescription
data (required)readonly DonutSlice[]NonePart-to-whole only, at most 6 slices: fold the rest into "Other". Negative values count as 0.
diameternumber200Outer diameter of the ring in px; the chart is a circle of this width and height.
format((n: number) => string)compact numbers in localeFormats values in the tooltip and legend.
localestring"en"Locale for the default number format and percentages (e.g. "de").
emptyStateReactNodeNoneShown in the centre when there is nothing to plot (no slices, or every value is 0).
legendTogglebooleantrueLegend items toggle slices (the ring re-flows, the total updates).
hiddenSlicesreadonly string[]NoneSlice keys (or labels) to hide (controlled).
defaultHiddenSlicesreadonly string[][]Slice keys (or labels) hidden at first (uncontrolled).
onHiddenSlicesChange((keys: string[]) => void)NoneCalled with the keys of the hidden slices whenever the legend toggles one.
glowbooleantrueSoft glow on the active slice in dark mode.
patternsbooleantrue when data.length > 3Tell slices apart without colour (hatch fills).
labelsPartial<DonutChartLabels>defaultDonutChartLabelsThe chart's built-in strings (empty state, table text); a partial object over the English defaults, so pass only the keys you translate. Every other string, for translation: labels={{ legend: "…" }}; omitted keys keep the English of defaultDonutChartLabels. All 7 keys of DonutChartLabels are listed in the key table under the props table.
aria-label (required)stringNoneNames the chart for assistive tech (required).
classNamestringNoneAdds extra classes to the outer element.
DonutChartLabels keys and English defaults (7)
Pass any key in labels; the rest keep the defaults of defaultDonutChartLabels.
KeyEnglish default
legendSlices: press to show or hide
shown(label) => `${label} shown`
hidden(label) => `${label} hidden`
instructionsUse arrow keys to read each slice.
noDataSuffixno data
percent(pct) => `${pct} percent`
centerTotal

RadialProgress

PropTypeDefaultDescription
value (required)number | null | undefinedNone0–100. Values outside the range are clamped. null, undefined or NaN (no value yet) show an empty ring with a "–" and "No data", not 0%.
labelReactNodeNoneVisible caption under the percentage; also the accessible name unless aria-label is given.
aria-labelstringNoneAccessible name when label isn't plain text.
variant"ring" | "gauge""ring""ring" = full circle, "gauge" = 3/4 arc like a speedometer.
coloring"accent" | "severity""accent""accent" always uses the accent colour. "severity" turns warning at warnAt and danger at dangerAt (e.g. storage nearly full) and adds a status word, so colour is never the only signal.
tone"accent" | "severity"undefinedOld name of coloring (it picks how the arc is coloured, it is not a semantic tone). Still honoured; coloring wins.
warnAtnumber75Percentage where the "severity" coloring turns to warning.
dangerAtnumber90Percentage where the "severity" coloring turns to danger.
diameternumber160Diameter in px (the width of the ring; a gauge is a little shorter).
gradientbooleantrueThe arc brightens along its length (a soft gradient).
glowbooleantrueSoft glow on the arc in dark mode.
localestring"en"Sets the locale for the percentage (e.g. "de" → "64 %").
labelsPartial<RadialProgressLabels>defaultRadialProgressLabelsThe ring's built-in strings (accessible names, table text); a partial object over the English defaults, so pass only the keys you translate. Every other string, for translation: labels={{ high: "…" }}; omitted keys keep the English of defaultRadialProgressLabels. All 4 keys of RadialProgressLabels are listed in the key table under the props table.
classNamestringNoneAdds extra classes to the outer element.
RadialProgressLabels keys and English defaults (4)
Pass any key in labels; the rest keep the defaults of defaultRadialProgressLabels.
KeyEnglish default
highHigh
criticalCritical
noDataNo data
fallbackNameProgress

Sparkline

PropTypeDefaultDescription
values (required)readonly number[]NoneValues, oldest first. Non-numeric entries are skipped.
variant"accent" | "muted""accent""muted" de-emphasises the trend; "accent" draws it in the first chart colour.
tone"accent" | "muted"undefinedOld name of variant (it is a visual form, not a semantic colour). Still honoured; variant wins.
heightnumber40Height of the chart in px; the width follows the container.
areabooleantrueSoft fill under the line (a gradient that fades to transparent).
curveChartCurve"monotone""monotone" (default): a smooth curve that never overshoots. "linear": straight segments.
glowbooleantrueSoft glow on the latest point in dark mode.
emptyStateReactNode"No data"Shown when there are no values.
localestringthe browser'sLocale for the numbers in the spoken summary (e.g. "de").
labelsPartial<SparklineLabels>defaultSparklineLabelsEvery other string, for translation: labels={{ summary: "…" }}; omitted keys keep the English of defaultSparklineLabels. Its only key is listed in the key table under the props table.
aria-labelstringNoneNames the trend (e.g. "Weekly signups"); a summary of the values (count, min, max, latest) is appended. Without it the sparkline is decorative.
classNamestringNoneAdds extra classes to the outer element.
SparklineLabels keys and English defaults (1)
Pass any key in labels; the rest keep the defaults of defaultSparklineLabels.
KeyEnglish default
summary({ count, min, max, latest, format }) => `${count} ${count === 1 ? "point" : "points"}, min ${format(min)},...

ChartCard / ChartTable / ChartLegend

PropTypeDefaultDescription
title (required)stringNoneSets the card's heading text.
descriptionReactNodeNoneA line of context under the title (period, unit, source).
asideReactNodeNoneShown at the top right, e.g. a headline number.
legendreadonly LegendItem[]NoneLegend shown under the header. Omit for single-series charts (the title names the series).
tableReactNodeNoneTable view of the same data. When given, the card gets Chart / Table tabs.
headingLevelHeadingLevelOption3Heading level of the title (1 to 6, default 3), to fit the page outline, or "none" for a paragraph with no heading role (for an example).
children (required)ReactNodeNoneThe chart (or table) the card frames; it fills the card body under the title and description.
classNamestringNoneAdds extra classes to the card's outer element.
legendTogglebooleantrueInteractive legend: when the chart inside supports it (Line, Area, Bar, Donut), legend items become toggle buttons that hide / show a series.
defaultHiddenSeriesreadonly string[][]Hides these series at first (interactive legends).
exportableboolean | { formats?: ChartExportFormat[]; filename?: string; }falseA download menu: PNG / SVG of the chart (colours resolved, exactly as shown) and CSV of the data. true offers every format; or pick some, and name the file (default: the title).
csvChartCsvOptionsNoneData for the CSV download. Without it the CSV is read from the table view.
labelsPartial<ChartCardLabels>defaultChartCardLabelsThe card's built-in strings (tab names, CSV button, table text); a partial object over the English defaults, so pass only the keys you translate. Every other string, for translation: labels={{ chart: "…" }}; omitted keys keep the English of defaultChartCardLabels. All 19 keys of ChartCardLabels are listed in the key table under the props table.
surface"glass" | "plain""glass""glass" (default): a glass-2 card. "plain": the same card without backdrop blur, for cards nested inside another glass panel or many cards in view at once (the glass budget).
loadingbooleanfalseShow a skeleton placeholder instead of the chart (and the table) while data is on its way.
data (required)readonly ChartRow[]NoneThe rows to show: one object per row, holding the index key and one number per series key.
index (required)stringNoneThe key in each row that names the row, such as "month". It becomes the first column.
series (required)readonly CompareSeries[]NoneSeries to list as columns; one with a compareKey also gets a previous-period column.
format((n: number) => string)formatCompactFormats each number in the table cells.
indexLabelstringNoneHeader of the first column; the index key when left out.
captionstringNoneVisually hidden caption naming the table for screen readers.
items (required)readonly LegendItem[]NoneThe legend keys: one per series, with its label, color and key shape.
hiddenreadonly string[] | ReadonlySet<string>NoneLists the keys of hidden series (interactive legends).
onToggle((key: string) => void)NoneMakes items with a key toggle buttons.
onHighlight((key: string | null) => void)NoneCalled with the key under the pointer / focus (null when it leaves): charts dim the others.
ChartTooltip docked / glide / notesboolean / boolean / string[]false / truedocked pins a one-line readout to the top of the chart (narrow charts); glide eases it between points on a spring; notes adds lines under the values (e.g. an event marker). Visual only: the chart announces the same values.
ChartCardLabels keys and English defaults (19)
Pass any key in labels; the rest keep the defaults of defaultChartCardLabels.
KeyEnglish default
chartChart
tableTable
loadingLoading chart
viewAs(title) => `${title}: view as`
dataTable(title) => `${title} data table`
noDataNo data
previous(label) => `${label} (previous)`
options(title) => `${title}: download`
downloadPngDownload PNG
downloadSvgDownload SVG
downloadCsvDownload CSV
pngHintImage, 2× resolution
svgHintVector, for slides and docs
csvHintThe data, for spreadsheets
downloaded(file) => `Downloaded ${file}`
exportFailedDownload failed
legendSeries: press to show or hide
shown(label) => `${label} shown`
hidden(label) => `${label} hidden`

Sync, brush, annotations, export, live data

PropTypeDefaultDescription
<ChartSyncProvider store?>componentNoneCharts inside share their crosshair by x value. createChartSyncStore() syncs charts that don't share a parent.
useChartSync(enabled?)hookNoneFor chart authors: { synced, external, publish(key | null) }.
<ChartBrush count labelOf range onRangeChange values? minSpan? height? labels?>componentNoneThe range selector on its own, for custom charts. Two sliders: arrows, Page Up / Down, Home / End, Shift + arrows pan.
ChartAnnotation{ type: "line" | "band" | "event" | "range", … , label?, tone? }Nonetone: neutral, accent, success, warning, danger. Lines and bands are included in the axis range.
exportChartImage(el, "png" | "svg", name)functionNoneDownloads the chart inside el. serializeChartSvg / chartPngBlob / chartCsv / tableCsv are exported too.
useLiveData(initial, { next, interval?, max?, ref?, paused?, onPausedChange? })hookNone{ data, setData, paused, setPaused, running }: a sliding window that pauses off-screen and in hidden tabs.

ChartAnnotationsLayer props

PropTypeDefaultDescription
annotations (required)readonly ChartAnnotation[]NoneThe reference lines, bands, events and ranges to draw.
data (required)readonly ChartRow[]NoneThe chart's rows, used to place annotations that name an index value.
index (required)stringNoneThe key that names each row in data.
innerW (required)numberNoneSets the width of the plot area in px.
innerH (required)numberNoneSets the height of the plot area in px.
value (required)(v: number) => numberNoneValue → pixel along the value axis (y for columns and lines, x for horizontal bars).
position (required)(i: number) => numberNoneReturns the pixel (centre) of a row along the index axis.
bandnumber0Width of one category band (bar charts): ranges cover whole bands. 0 for line charts.
horizontalbooleanfalseThe value axis runs horizontally (horizontal bar charts).
layer (required)"back" | "front"None"back" draws bands and ranges (behind the data); "front" draws lines and events.
showbooleantrueFade in once the data has drawn.
delaynumber0Seconds to wait before fading in (after the draw-in).
reducedbooleanfalseSkip the fade-in because the person prefers reduced motion.
avoidreadonly AnnotationObstacle[]NoneThe series as polylines in plot px: band and line labels move to the corner or side where they cross them least.

ChartAnnouncer props

PropTypeDefaultDescription
text (required)stringNoneThe message for the polite live region; screen readers read it when it changes.

ChartBrush props

PropTypeDefaultDescription
count (required)numberNoneSets the number of rows in the full series.
labelOf (required)(i: number) => stringNoneLabel of row i (e.g. "Mar 4"), read out by screen readers.
valuesreadonly number[]NoneThe values drawn in the miniature (one series, all rows).
range (required)ChartBrushRangeNoneSelected rows, inclusive [start, end].
onRangeChange (required)(range: ChartBrushRange) => voidNoneCalled with the selected window as [start, end] (inclusive row indexes) while the handles move.
onScrubChange((scrubbing: boolean) => void)NoneTrue while a drag is in progress (charts skip their tweens while scrubbing).
minSpannumber2Fewest rows the window can show.
heightnumber44Height of the chart in px; the width follows the container.
colorstring"var(--sheen-chart-1)"Sets the colour used for the miniature chart.
labelsPartial<ChartBrushLabels>defaultChartBrushLabelsEvery other string, for translation: labels={{ group: "…" }}; omitted keys keep the English of defaultChartBrushLabels. All 4 keys of ChartBrushLabels are listed in the key table under the props table.
ChartBrushLabels keys and English defaults (4)
Pass any key in labels; the rest keep the defaults of defaultChartBrushLabels.
KeyEnglish default
groupVisible range
startStart of range
endEnd of range
value(label) => label

ChartSyncProvider props

PropTypeDefaultDescription
storeChartSyncStoreNoneShare an existing store (e.g. one made with createChartSyncStore) instead of a new one.

ChartTooltip props

PropTypeDefaultDescription
title (required)stringNoneThe heading line: usually the category or date being read.
rows (required)TooltipRow[]NoneOne line per series: a swatch, a label and the formatted value.
x (required)numberNoneHorizontal position of the pointer, in px from the left of the chart box.
y (required)numberNoneVertical position of the pointer, in px from the top of the chart box.
containerWidth (required)numberNoneWidth of the chart box in px, so the tooltip flips to stay inside it.
dockedbooleanfalsePin the readout to the top of the chart as one line instead of following the pointer (used on narrow charts).
surfaceTooltipSurface"glass"Surface style of the tooltip: glass or opaque.
glidebooleantrueGlide between points on the pointer spring (default) instead of jumping.
notesreadonly string[]NoneExtra lines under the values (e.g. an event marker at this point).

LegendKey props

PropTypeDefaultDescription
color (required)stringNoneAny CSS color for the swatch, normally a var(--sheen-chart-n) token.
kind"line" | "rect""rect""line" draws a short stroke (line charts); "rect" draws a filled square (bars, areas).
dashedbooleanfalseDraw the stroke dashed, for a comparison or forecast series.
hollowbooleanfalseDraw an outline only instead of a filled swatch.
patternnumber0Hatch index (1 to 8) so the swatch matches a series drawn with patterns. Rect keys only.

TableScroll props

PropTypeDefaultDescription
labelstringNoneAccessible name of the scroll region around the table.

Keyboard

KeysAction
TabMove through the card's tabs and menu, then the legend keys, then the chart and its brush handles.
← → (↑ ↓)Read the previous / next point (the crosshair moves and the values are announced).
Home/EndFirst / last point.
EscapeClear the active point.
Enter/Spaceon a legend keyHide or show that series (announced).
← →on a brush handleMove that edge one step; Page Up / Page Down move ten percent; Home / End go to the ends.
Shift + ← →on a brush handlePan the whole window.
← →on Chart / TableSwitch between the chart and its table.

Accessibility

  • Every interactive chart is a focusable figure named by its title and described by the reading instructions (the same key on every chart, `labels.instructions`, a string or a function); inside a ChartCard with a table, `aria-details` points at the table view. The active values are announced once, politely.
  • Every chart has a table view (Chart / Table tabs), so no value depends on color or on seeing the marks.
  • Legend keys are toggle buttons (pressed = shown); hiding or showing a series is announced.
  • Event markers are read out with the data point they sit on; status colors always come with a word or an icon.
  • Reduced motion: charts appear at their final values, data changes jump, and live charts stop sliding.
  • Windows High Contrast: legend keys gain outlines, the active tab and brush window use system colors.

All exports on this page

Show all 37 exports
  • ChartAnnotationsLayer — Draws annotations inside a chart's plot group (already translated to the plot origin).
  • ChartAnnouncer — Screen-reader announcement of the active data point (charts are keyboard-navigable).
  • ChartBrush — Memoised: the chart above re-renders on every pointer move, the brush only when its range does.
  • ChartCard — A glass card with header, legend and (when table is given) Chart / Table tabs.
  • ChartLegend — Legend keys mirror the mark: a short line for line charts, a swatch for bars/areas.
  • ChartSyncProvider — Groups charts so one reading drives all of them.
  • ChartTable — Every chart has a table view: the accessible, colour-free way to read every value.
  • ChartTooltip — Glass tooltip positioned inside the chart container.
  • ChartWidthHint — The width (px) charts inside can assume before they have measured themselves, e.g.
  • LegendKey — The colour key for a series, drawn as SVG (not a CSS background) so it survives forced-colors / Windows High Contrast.
  • RadialProgress — A single ratio against a limit.
  • TableScroll — Horizontal scroll container for a table view: when the table is wider than the card, it scrolls inside (never the page).
  • annotationColors — Stroke / fill / text colours for a tone (tokens only).
  • annotationValues — Values the value axis should include so every reference line and band is on screen.
  • chartTooltipSurface — Classes + style for a chart tooltip surface (for charts that build their own tooltip).
  • clampBrushRange — Keep a range inside [0, count - 1] with at least minSpan rows.
  • createChartSyncStore — A standalone sync store, for syncing charts that don't share a parent (pass it as store).
  • defaultBrushRange — A sensible starting window: the last fraction of count rows (at least minSpan).
  • defaultChartBrushLabels — The built-in English strings of ChartBrush; spread it into your own labels and change what you need.
  • defaultChartCardLabels — The built-in English strings of ChartCard; spread it into your own labels and change what you need.
  • defaultChartLegendLabels — The built-in English strings of ChartLegend; spread it into your own labels and change what you need.
  • defaultChartTableLabels — The English strings of ChartTable (and of the empty state); a ChartCard's labels override them below it.
  • defaultRadialProgressLabels — The built-in English strings of RadialProgress; spread it into your own labels and change what you need.
  • dockSpace — Height to reserve above the plot for the docked readout (touch screens): the lines the widest readout ANY point produces.
  • eventsAt — Event markers that sit on row i (read out with that row's values).
  • fitTicks — Round ticks that hug the data AND fit the axis.
  • formatCompact — 1,284 · 12.9K · 4.2M · −640
  • localeTickFormat — formatTick for any locale: ticks keep exactly the decimals their step needs (0.25 stays 0,25 in German), compact from 10,000.
  • percentChange — Signed percent change from previous to current ("+12.4%", "−3%"), or null when undefined.
  • seriesLegend — Builds the ChartLegend items for a list of series (colour by position, key shape line or rect).
  • useChartFrame — useElementWidth that also hands back the element itself (for in-view checks, exports and pointer maths).
  • useChartSeriesState — Hidden / highlighted series state for building your own interactive legend + chart pair.
  • useChartSeriesVisibility — For chart authors: the series visibility to draw with.
  • useChartSharedLabels — Text a ChartCard hands down to its table and empty states (labels.noData, labels.previous).
  • useChartSync — For chart authors.
  • useElementInView — Whether element is in the viewport (IntersectionObserver).
  • withMinimum — Give every non-zero length at least min (so a 0.1% share still draws a visible mark), taking the room from the larger ones in proportion.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .