Sparkline Reference

Inline in stat cards

REVENUE

+14%

$48,295

ACTIVE USERS

+8%

12,840

BOUNCE RATE

+5%

42.3%

LATENCY

+12ms

124 ms

Color variants — line

.ui-sparkline:primary

.ui-sparkline:success

.ui-sparkline:danger

.ui-sparkline:warning

.ui-sparkline:info

.ui-sparkline:muted

Bar type

WEEKLY SALES

+9%

$8,420

DAILY ERRORS

+3

17

SIGNUPS

+21%

340

LOAD TIME

avg 1.4s

1.2 s

Options

fill: true; dot: true (defaults)

fill: false; dot: false

strokeWidth: 3

fill: false; dot: false; strokeWidth: 2

In a table

RepositoryBranchCommits (30d)TrendStatus
ui-framework main 84
Passing
design-tokens main 31
Passing
docs-site dev 57
Warnings
api-gateway fix/auth 12
Failing

Reference

Base

AttributeDescription
ui-sparkline="..."Add to any block element. The JS replaces its content with an inline SVG.

Modifiers

ClassDescription
.ui-sparkline:primaryPrimary color stroke / fill
.ui-sparkline:successSuccess (green) color
.ui-sparkline:dangerDanger (red) color
.ui-sparkline:warningWarning (amber) color
.ui-sparkline:infoInfo (blue) color
.ui-sparkline:mutedMuted (grey) color

Options

OptionDefaultDescription
values: 1,2,3,Comma-separated numeric data points (required)
type: linelineline or bar
width: 120120SVG width in px
height: 3636SVG height in px
strokeWidth: 1.51.5Line stroke width in px
fill: truetrueFill area under the line
dot: truetrueShow a dot at the last data point
gap: 22Gap between bars (bar type only)
color: #hexcurrentColorOverride the stroke/fill color directly