Data display
Sparkline
Shows a compact, text-labelled trend beside an existing metric.
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.
Downloads
18,420
Framework usage
Switch targets to compare the adapter code. The preview stays visually stable because all three packages share the same tokens andui-* class contract.---
import { Sparkline, Stat } from '@santi020k/lumen-astro'
---
<div style="display: flex; align-items: end; justify-content: space-between; gap: 1rem">
<Stat label="Downloads" value="18,420" />
<Sparkline
area
label="Downloads increased from 42 to 91"
values={[42, 48, 63, 58, 74, 91]}
/>
</div>import { Sparkline, Stat } from '@santi020k/lumen-react'
export const Example = () => (
<>
<div style={{ display: 'flex', alignItems: 'end', justifyContent: 'space-between', gap: '1rem' }}>
<Stat label="Downloads" value="18,420" />
<Sparkline
area
label="Downloads increased from 42 to 91"
values={[42, 48, 63, 58, 74, 91]}
/>
</div>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<div style="display: flex; align-items: end; justify-content: space-between; gap: 1rem">
<lumen-stat label="Downloads" value="18,420"></lumen-stat>
<lumen-sparkline
area
label="Downloads increased from 42 to 91"
values={[42, 48, 63, 58, 74, 91]}></lumen-sparkline>
</div>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.
pnpm add @santi020k/lumen-astropnpm add @santi020k/lumen-astrolumen add Sparklinelumen add Sparklinepnpm add @santi020k/lumen-reactpnpm add @santi020k/lumen-reactlumen add Sparkline --target reactlumen add Sparkline --target reactpnpm add @santi020k/lumen-elementspnpm add @santi020k/lumen-elementslumen add Sparkline --target elementslumen add Sparkline --target elementsAPI 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.
| Attribute | Values | Default | Description |
|---|---|---|---|
| values | number[] | required | Provides ordered values for the compact trend. |
| label | string | required | Communicates the trend in text because the SVG is intentionally decorative. |
| area | boolean | false | Adds a subtle tokenized fill below the line. |
| showEndpoint | boolean | true | Marks the latest value with a color-independent endpoint. |
| tone | LumenChartTone | "series-1" | Selects a categorical or explicitly semantic chart tone. |
| class, className | string | "" | Merges custom classes with the generated ui-* root classes. |
| ...native attributes | HTML attributes | - | Forwards standard attributes to the root element unless the component consumes them. |