Skip to main content
196

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Web docs
Data display

RangeChart

Shows ordered low-to-high intervals as a tokenized range band.

FrameworksAstro · React · Elements

Registry commandlumen add RangeChart

InteractionEnhanced runtime

← All chart guides · Framework setup · Native counterparts

01

See it and copy it

Framework example

Explore the live chart, then open its code for Astro, React, or Elements.

AstroCode target · live preview uses Astro

A warm start, a cooler weekend

Daily temperature range (°C) · 21–27 September 2026

7 available ranges.

View chart data
CategoryLowHigh
Mon1424
Tue1627
Wed1931
Thu1829
Fri1525
Sat1222
Sun1324
The band connects each day's low and high. Wednesday peaks at 31°C before temperatures ease into the weekend. Illustrative forecast.
View RangeChart code

Framework usage

Switch targets to compare the adapter code. This live preview runs the Astro example. React and Elements use their own behavior APIs; complete the matching framework setup before copying an example.
astro
---
import { RangeChart } from '@santi020k/lumen-astro'

const data = [
  { high: 24, low: 14, x: 'Mon' },
  { high: 27, low: 16, x: 'Tue' },
  { high: 31, low: 19, x: 'Wed' },
  { high: 29, low: 18, x: 'Thu' },
  { high: 25, low: 15, x: 'Fri' },
  { high: 22, low: 12, x: 'Sat' },
  { high: 24, low: 13, x: 'Sun' }
]
---

<RangeChart
  aria-label="Daily low and high forecast temperatures in degrees Celsius"
  heading="A warm start, a cooler weekend"
  description="Daily temperature range (°C) · 21–27 September 2026"
  caption="The band connects each day's low and high. Wednesday peaks at 31°C before temperatures ease into the weekend. Illustrative forecast."
  {data}
/>
Edit RangeChart in browser

Framework differences

Elements: Pass data as a JSON attribute. The Elements example serializes the sample data with JSON.stringify; Astro expression bindings are not HTML attributes.

When to use RangeChart

Use for forecast bounds, daily temperature ranges, or another ordered sequence where both limits are meaningful.

  • The vertical interval shows the two bounds; the band connects adjacent complete observations.
  • Explain what the bounds mean in the caption: minimum/maximum, forecast limits, or a stated confidence interval. Use formatValue to attach the same unit to both endpoints.

Prepare the data

ts
import type { LumenRangeDatum } from '@santi020k/lumen-core'

const data = [
  { x: 'Mon', low: 17, high: 28 },
  { x: 'Tue', low: 19, high: 31 },
  { x: 'Wed', low: null, high: null }
] satisfies readonly LumenRangeDatum[]
  • Supply one low/high pair per X identity, in the intended display order. Keep both endpoints finite and ensure low is no greater than high in your application.
  • A null endpoint removes that interval and breaks the band. The data table still reports each supplied endpoint.
  • X positions follow input order at equal spacing. Use xLabel for readable category text without changing identity.

Shared data and formatting guidance →

Avoid misleading comparisons

  • A range does not communicate a median, sample size, or probability by itself. State the statistical meaning of a forecast band.
  • This component does not expose a time-scale prop. Equal spacing can be misleading for irregular observation times.

Chart accessibility and keyboard guidance →

02

Choose your target

Add this component

Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.

bash@santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
bashAstro wrapper
lumen add RangeChart
lumen add RangeChart

API reference

Lumen-specific props and runtime attributes for the Astro primitive. Use the framework differences above and the copyable examples for React composition and Elements attributes; the public adapter types define their supported contracts.

AttributeValuesDefaultDescription
drilldownboolean (Astro / Elements attribute)falseEnables plotted datum actions and an equivalent native button disclosure, including with hidden tables. Astro requires UIPrimitives; Elements owns its lifecycle.
onDatumActivate(detail: LumenChartDatumActivationDetail) => void (React)-Enables React datum actions and receives validated values with raw identities. Navigation and filtering remain application owned.
explore-data-label, datum-action-prefix, datumActionFormatterstring attributes, (context: string) => string property (Elements)English labelsLocalizes the Elements disclosure and datum actions.
labels.exploreData, labels.formatDatumActionstring, (context: string) => stringEnglish labelsLocalizes the actions disclosure and each contextual datum button.
dataLumenRangeDatum[][]Provides ordered low and high values for each interval.
formatValue(value: number) => stringStringFormats interval endpoints in titles and the accessible data table.
toneLumenChartTone"series-1"Selects the tokenized chart tone for intervals and the range area.
showTablebooleantrueProvides a revealable semantic table containing every range.
class, classNamestring""Merges custom classes with the generated ui-* root classes.
...native attributesHTML attributes-Forwards standard attributes to the root element unless the component consumes them.

Keyboard interactions

Keyboard behavior provided by the Astro UIPrimitives runtime for this component.

KeyAction
TabFocus the actions disclosure and its native buttons in document order.
Enter, SpaceToggle the disclosure or activate the focused datum button. Actions remain available when the data table is hidden.

Runtime events

CustomEvents dispatched by the Astro UIPrimitives runtime for this component.

EventTargetDetailWhen
ui:chart-datum-activateAstro chart figure or Elements data chart hostLumenChartDatumActivationDetail: series { seriesId, x, y, datumId? }, heatmap { x, y, value, datumId? }, range { x, low, high, datumId? }Fires once after a plotted datum or its native action button is activated. Requires drilldown. Astro uses UIPrimitives, Elements owns its lifecycle, and React uses onDatumActivate instead.

Web docsFull catalog