Charts
Sparkline
Inline micro charts for KPI cards, table rows and live streams.
<script>
import { Sparkline } from "@codeatlasdev/ui/charts";
</script>
<Sparkline data={[42, 51, 58, 63, 72]} trend="up" height="32px" />
A sparkline has no axes, legend or tooltip. trend picks the color: success for up, error for down and a neutral tone otherwise.
KPI cards with trend lines
$112k
+18.4%
24.8k
+12.1%
2.3%
-0.4%
4m 12s
-8.2%
Code
Table row sparklines
| Product | Last 6 months | Trend |
|---|---|---|
| Atlas Pro | ▲ Growing | |
| Nova Suite | ▲ Growing | |
| Relay SDK | → Stable | |
| Mesh API | ▼ Declining |
Code
Bar sparklines
variant bar draws narrow columns instead of a line.
Weekly sessions
Bounce rate
Avg pages
Code
Live streaming micro charts
CPU 62%
Memory 73%
Network 35%
Code
Props
| Prop | Type | Default | Description |
|---|---|---|---|
data | number[] | – | Values to plot. |
variant | 'line' | 'bar' | 'line' | Line with a soft area, or narrow bars. |
trend | 'up' | 'down' | 'neutral' | – | Colors the series: success, error or neutral. |
color | string | – | Explicit hex or rgb color. Overrides trend. Use hex or rgb, not oklch. |
height | string | '48px' | CSS height of the chart. |
class | string | '' | Extra class names. |