Sparkline
Compact inline SVG sparkline chart
Accessibility
- Treat the component as presentational unless it exposes interactive affordances, and label any interactive affordances explicitly.
- Keep heading, reading, and focus order aligned with the surrounding content.
- Expose the essential data in text form, such as a summary, value list, or table, rather than relying on the graphic alone.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
svelte
<script lang="ts">
import '@dryui/ui/themes/default.css';
import '@dryui/ui/themes/dark.css';
import { Sparkline } from '@dryui/ui';
</script>
<Sparkline data={[5, 10, 3, 8, 12, 7]} width={120} height={30} /> Import options
Root package
ts
import { Sparkline } from '@dryui/ui' Per-component subpath
ts
import { Sparkline } from '@dryui/ui/sparkline' API
Props, CSS variables, and the public data attributes you can target when styling.
| Prop | Type | Description | Default | Required | Bindable |
|---|---|---|---|---|---|
| data | number[] | — | — | ✓ | — |
| width | number | — | 100 | — | — |
| height | number | — | 32 | — | — |
| color | string | Semantic color or tone applied to the component. | 'currentColor' | — | — |
| filled | boolean | — | false | — | — |
| strokeWidth | number | — | 2 | — | — |
| highlightLast | boolean | — | false | — | — |