Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Web docs
Data displayGlass surface

LineChart

Shows ordered trends, multiple series, missing-value gaps, areas, markers, and reference values.

FrameworksAstro · React · Elements

Registry commandlumen add LineChart

InteractionNative markup

01

See it and copy it

Framework example

Choose Astro, React, or Elements to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.

AstroSame visual contract, native framework API

Website traffic

2 series, 10 points. Values range from 82 to 238.

  • Page views
  • Visits
View chart data
CategoryPage viewsVisits
Mon12082
Tue168104
Wed15497
Thu201128
Fri238146
Traffic increased through the end of the week.

Framework usage

Switch targets to compare the adapter code. The preview stays visually stable because all three packages share the same tokens and ui-* class contract.
astro
---
import { LineChart } from '@santi020k/lumen-astro'

const series = [
  {
    data: [
      { x: 'Mon', y: 120 },
      { x: 'Tue', y: 168 },
      { x: 'Wed', y: 154 },
      { x: 'Thu', y: 201 },
      { x: 'Fri', y: 238 }
    ],
    id: 'views',
    label: 'Page views'
  },
  {
    data: [
      { x: 'Mon', y: 82 },
      { x: 'Tue', y: 104 },
      { x: 'Wed', y: 97 },
      { x: 'Thu', y: 128 },
      { x: 'Fri', y: 146 }
    ],
    id: 'visits',
    label: 'Visits'
  }
]
---

<LineChart
  aria-label="Page views and visits from Monday through Friday"
  area
  caption="Traffic increased through the end of the week."
  heading="Website traffic"
  {series}
/>
Edit LineChart in browser
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 LineChart
lumen add LineChart

Glass

Add the glass prop to apply the shared blur, saturation, border, and highlight tokens. Glass reads best over vivid content, so place the surface above imagery or color.

AstroSame visual contract, native framework API

Coverage

1 series, 4 points. Values range from 94 to 98.

View chart data
CategoryCoverage
Mon94
Tue96
Wed95
Thu98

Framework usage

Switch targets to compare the adapter code. The preview stays visually stable because all three packages share the same tokens and ui-* class contract.
astro
---
import { LineChart } from '@santi020k/lumen-astro'

const series = [
  {
    data: [
      { x: 'Mon', y: 94 },
      { x: 'Tue', y: 96 },
      { x: 'Wed', y: 95 },
      { x: 'Thu', y: 98 }
    ],
    id: 'coverage',
    label: 'Coverage'
  }
]
---

<div class="docs-glass-demo">
  <LineChart
    aria-label="Test coverage"
    area
    glass
    heading="Coverage"
    referenceValue={95}
    {series}
  />
</div>
Edit LineChart in browser

API reference

Lumen-specific props and runtime attributes for the Astro primitive. React props follow the same names; Elements use equivalent kebab-case attributes where custom elements expose them.

AttributeValuesDefaultDescription
glassboolean | "subtle" | "strong"falseApplies the tokenized liquid-glass surface treatment with backdrop-filter fallbacks; "subtle" and "strong" adjust the fill intensity.
seriesLumenChartSeries[]requiredProvides ordered, already-aggregated points; null y values create visible gaps.
areabooleanfalseAdds a tokenized fill between each line segment and the zero or domain baseline.
markers"auto" | "all" | "none" | boolean | number"auto"Controls marker density; a number displays every nth point while retaining all line and table data.
formatCategory, formatValueformatter functionsStringFormats axes, SVG titles, and the accessible data table without changing data identity.
emptyLabelstring"No chart data available."Provides actionable, source-specific empty-state guidance.
referenceValuenumber-Draws a dashed threshold or comparison line across the plot.
showLegendbooleantrue for multiple seriesShows the color-independent series key.
showTablebooleantrueProvides a revealable semantic table containing every plotted value.
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.

Web docsFull catalog