Skip to content
Display

Sparkline

Server Component

Tiny inline line, area, or bar trend chart for stat tiles.

Import

tsx
import { Sparkline } from "@cronus-ui/ui";
bash
npx cronus-ui add sparkline

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component SparklineDefault layout:inline style:sparkline {
  data:"4,8,6,10,7"
  aria-label:"Trend"
  label "Trend"
}

page "/audit/sparkline/default" type:custom {
  use SparklineDefault
}

API Reference

Generated from the component's exported types.

SparklineProps

Extends Omit<SVGAttributes<SVGSVGElement>, "type">

Skip SparklineProps props table
PropTypeDefaultDescription
data*
number[]—The series to plot. Order is preserved; values map left→right.
width
number96Intrinsic width of the SVG in px.
height
number28Intrinsic height of the SVG in px.
type
SparklineType"line"Render a connected line or evenly spaced bars.
tone
SparklineTone"primary"Color, mapped to a token via `currentColor`.
area
booleanfalseFor `type="line"`, fill a soft token-tinted gradient under the line.
strokeWidth
number1.5Stroke width of the line (line type only).
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.
viewBox
string——
aria-hidden
boolean——