Chart style

Applies to every chart.

Palette

Theme

Appearance

Depth
Surface
Background

Reading & motion

Axis
Hover
Legend
Numbers
Loading
Empty
Using chart defaults
3,109npm
1stars

Charts

Every chart, by the job it does

Trends3

  • Area
  • Line
  • Combo

Comparison4

  • Bar
  • Horizontal bar
  • Slope
  • RangeNew

Part of a whole4

  • Radial
  • Treemap
  • Funnel
  • Sankey

KPIs3

  • Stat cards
  • Progress
  • Activity ring

Patterns4

  • Heatmap
  • Scatter
  • Radar
  • Box plotNew

Cool23

  • Chord loomNew
  • Rank ribbonsNew
  • Event helixNew
  • Contour islandsNew
  • Parallel ribbonsNew
  • Sunburst terracesNew
  • Cluster constellationNew
  • Ternary prismNew
  • Wind roseNew
  • Marimekko blocksNew
  • Intersection towersNew
  • Horizon foldsNew
  • Circle archipelagoNew
  • Helix ribbonsNew
  • Voxel cloudNew
  • Arc bridgesNew
  • TerrainNew
  • Hex cityNew
  • Voxel waffleNew
  • SkylineNew
  • Block cityNew
  • RidgelineNew
  • Spiral yearNew

Finance6

  • CandlestickNew
  • IndicatorsNew
  • PriceNew
  • DepthNew
  • Order bookNew
  • PortfolioNew

Range chart

Temperature by month

13.3°C13.3°C
JanJul
Default01 / 03

Usage

Import the component and the stylesheet once. See Getting started to install the package.

import { RangeChartCard } from '@lilt-ui/charts';
import '@lilt-ui/charts/styles.css';
<RangeChartCard
  title="Temperature by month"
  data={temperature}
  x="month"
  low="low"
  high="high"
  value="mean"
/>

Omit title to leave out the visible title. Set header={false} to remove the whole header, and use aria-label to name a chart inside your own card. legend={false} removes the legend independently. surface="ghost" controls only the visual frame. See Card composition.

Data

Each range needs low at or below high; error bars also need the value between them. The headline averages the values by default (aggregate="mean"), because ranges rarely add up. Without value, the high of each range drives the headline and pills. The same marks are available as RangeBar and ErrorBar primitives, reading any series’ fields.

// One row per x with the low and high of its range, and optionally a value inside it.
const temperature = [
  { month: 'Jan', low: 2, high: 9, mean: 5.5 },
  { month: 'Feb', low: 3, high: 11, mean: 7 },
];

Timeline intervals

TimelineChartCard draws elapsed time horizontally. Dates, ISO strings, and epoch milliseconds are accepted. Missing endpoints stay unplotted and are counted; reversed intervals are rejected. Overlaps stack without hiding observations. Duration values and summaries are milliseconds, formatted as hours by default; simultaneous intervals add independently.

import { TimelineChartCard } from '@lilt-ui/charts';

<TimelineChartCard data={deployments} id="id" label="task" start="start" end="end" lane="service" group="state" />
PropTypeDescription
titlestringOptional visible title. Omit to render no title. Also supplies the accessible name unless aria-label is set.
headerbooleanDefaults to true. False removes the whole header: title, headline, delta and period controls, with no reserved space. Pass data directly when your app owns period selection.
aria-labelstringAccessible chart name, independent of the visible title. Falls back to title, then a generic chart name.
dataRow[]One row per observation. Omit when using ranges.
heightnumberMinimum plot height, default 260. Dense lanes expand to keep every mark visible.
depthbooleanLit tiles, solid bars, or spheres. Data positions remain exact; loading keeps the same depth treatment.
colorstringOverride the palette with one CSS color.
aggregate'sum' | 'mean' | 'max'Resting headline summary; Strip defaults to mean, the others to sum.
headlinenumberOverride the resting headline.
deltanumberFractional change shown alongside the headline.
deltaTone'default' | 'inverse' | 'neutral'Use inverse when a decrease is good.
rangestringStatic period label.
ranges{ id, label, data, headline?, delta? }[]Period choices with their own data.
defaultRangestringInitial period id.
localestringLocale for numbers and dates; defaults to en-US.
formatValue(value: number) => stringCustom value formatter.
badgeReactNodeContent for the glass tab above the card.
classNamestringClass on the card frame.
styleCSSProperties | ChartStyleInline styles and scoped chart variables.
onSelectionChange(selection | null) => voidReports id, original row (or null for an absent day), value, and pinned state.
renderReadout(selection | null) => ReactNodeConsumer-owned readout, including when the header is hidden.
valueFormatIntl.NumberFormatOptionsFormats the headline, tiles, and axis, e.g. currency.
surface'elevated' | 'outline' | 'ghost'Card treatment. Ghost removes the visual frame only; header and legend are independent controls.
palette'iris' | 'cobalt' | 'emerald'Series colors. Iris by default; explicit series colors still win.
numberStyle'count' | 'pop' | 'slide' | 'roll' | 'flow' | 'scramble'How the headline animates when its value changes. Count (default) counts to the new value.
loadingbooleanShows a neutral loading skeleton, not data.
loadingStyle'shimmer' | 'draw' | 'breathe'Shimmer sweeps a highlight over still shapes; draw reveals them in order; breathe lets them settle. Follows the selected look, including depth, and respects reduced motion.
empty'dots' | 'shape' | ReactElement | nullWhat the card shows when the period has no data. Dots (default) gathers a quiet dot field around the message; shape lays the chart’s own outline behind it. Pass `<ChartEmpty>` with your own words, any element of your own, or null for nothing. Both looks stay still, so empty never reads as loading, and the headline reads a dash, never zero.
motion'auto' | 'none'None turns off decorative motion; reduced motion does this automatically.
labeltext key of RowNames each interval; must be unique unless id is supplied.
idtext key of RowStable unique interval identity.
startdate, string, or numeric key of RowUTC endpoints. Equal endpoints render a small instant marker.
enddate, string, or numeric key of RowUTC endpoints. Equal endpoints render a small instant marker.
lanetext key of RowGroups intervals into labeled lanes; overlaps get separate subrows.
grouptext key of RowColors intervals by a category and creates its duration legend.
formatTime(timestamp: number) => stringFormats axis ticks and endpoint readouts.
legendfalse | 'tiles' | 'inline' | 'list' | 'pills' | 'bars'Duration legend layout; tiles by default.
legendSwatch'square' | 'dot' | 'line'Legend marker; square by default.
onKeyDownKeyboardEventHandler<HTMLElement>Keyboard handler on the card frame. Chart inspection also has its own keyboard handling.

Props

Every prop RangeChartCard accepts, in the order you are likely to reach for them.

PropTypeDescription
titlestringOptional visible title. Omit to render no title. Also supplies the accessible name unless aria-label is set.
dataRow[]One row per x position. Omit when using ranges.
xkey of RowText, number, or Date field for the x axis.
lowkey of RowNumeric field holding each range’s low.
highkey of RowNumeric field holding each range’s high.
valuekey of RowNumeric field holding the measured value. Defaults to high.
labelstringNames the series in hover.
colorstringAny CSS color.
display'bar' | 'error'Floating bars (default), or whiskers around a dot at the value.
depthbooleanDraws each bar as a solid block whose front spans exactly low to high. Error bars stay flat.
headerbooleanDefaults to true. False removes the whole header: title, headline, delta and period controls, with no reserved space. Pass data directly when your app owns period selection.
aria-labelstringAccessible chart name, independent of the visible title. Falls back to title, then a generic chart name.
deltanumberFractional change for the chip: 0.082 shows +8.2%.
deltaTone'default' | 'inverse' | 'neutral'Use inverse when a decrease is good.
headlinenumberResting headline. Defaults to the aggregate of non-reference series; dashed series are excluded.
rangestringStatic period label in the header.
ranges{ id, label, data, delta?, headline? }[]Turns the period label into a select. Each range swaps the data.
valueFormatIntl.NumberFormatOptionsFormats the headline, tiles, and axis, e.g. currency.
legendfalse | 'tiles' | 'inline' | 'list' | 'pills' | 'bars'False removes the legend without changing the data. How the legend under the plot lays out: value tiles (default), a compact inline key, list rows, tinted pills, or bars that also draw each value against the largest.
legendSwatch'square' | 'dot' | 'line'The mark beside each legend label. Defaults to a rounded square.
heightnumberPlot height in pixels. Defaults to 240.
axis'minimal' | 'dots' | 'inline' | 'ruler' | 'classic' | 'segmented' | { x, y }Axis preset. Minimal (default) labels only the x ends and has no grid. Set one per axis with `{ x, y }`; a segmented axis can take a `gradient` to read as a range.
hover'pills' | 'tooltip' | 'strip' | 'headline'The one readout for the hovered point: pills on the axes (default), a tooltip with every series, a strip docked above the plot, or the headline and tiles alone.
hoverStyle'soft' | 'solid' | 'accent'How the pills or tooltip look. Soft (default) is surface glass; accent tints it with the hovered series.
pillPosition'auto' | 'mark' | 'axis'Where the value pill sits: above the hovered mark, or on the y axis. Auto picks mark when there are no y labels.
tooltipIndicator'square' | 'dot' | 'line'Series marker on each tooltip row, with hover="tooltip". Square by default.
background'dots' | 'grid' | 'lines' | 'none'Texture behind the marks. Dots by default, with a hover spotlight.
surface'elevated' | 'outline' | 'ghost'Card treatment. Ghost removes the visual frame only; header and legend are independent controls.
palette'iris' | 'cobalt' | 'emerald'Series colors. Iris by default; explicit series colors still win.
axisInsetnumberPadding between the plot edges and axis labels or pills.
loadingbooleanShows a neutral loading skeleton, not data.
loadingStyle'shimmer' | 'draw' | 'breathe'Shimmer sweeps a highlight over still shapes; draw reveals them in order; breathe lets them settle. Follows the selected look, including depth, and respects reduced motion.
empty'dots' | 'shape' | ReactElement | nullWhat the card shows when the period has no data. Dots (default) gathers a quiet dot field around the message; shape lays the chart’s own outline behind it. Pass `<ChartEmpty>` with your own words, any element of your own, or null for nothing. Both looks stay still, so empty never reads as loading, and the headline reads a dash, never zero.
compareboolean | 'headline' | 'badge'Drag across the plot to compare two points in time. True or headline reads the change in the headline; badge reads it in the card’s tab and leaves the headline at rest.
syncstringLink hover and pins with every card that uses the same name, matched by x value. A click pins them all, with a ghost pin on the others; Alt-click pins one card only.
numberStyle'count' | 'pop' | 'slide' | 'roll' | 'flow' | 'scramble'How the headline animates when its value changes. Count (default) counts to the new value.
motion'auto' | 'none'None turns off decorative motion; reduced motion does this automatically.
aggregate'sum' | 'mean' | 'last' | 'max'Summary at rest: sum for counts, mean for rates, last for levels, or max for peaks. Area defaults to sum; Range defaults to mean.
defaultRangestringInitial range id; defaults to the first supplied range.
localestringLocale used for number formatting. Defaults to en-US.
formatValue(value: number) => stringCustom value text, taking precedence over valueFormat.
formatAxisValue(value: number) => stringCustom compact axis value text.
formatX(value: string | number | Date) => stringCustom x label text.
xType'category' | 'number' | 'time'Override inferred x type. Use time for numeric Unix timestamps in milliseconds.
spotlightbooleanHighlight the inspected position in the plot background. Defaults to true.
badgeReactNodeContent in the tab above the card. A comparison badge can replace this while a comparison is active.
classNamestringAdditional class on the card frame.
styleCSSProperties | ChartStyleInline styles and scoped --lilt-* chart variables.
pillValue'series' | 'stack'Read an individual series value (default) or its stacked height. Has no effect when the card has no stacked series.
decimatebooleanDefaults to true. Line and Area marks retain at most four observations per pixel column. Other marks draw every row; inspection and summaries always read the full data.
tilesbooleanShow the range series value tile beneath the plot. Defaults to false.