KPI tiles
Use them for the three to eight numbers someone should see first. Always pair the value with a change (arrow, size and period in words) and use the skeleton while data loads.
How to use it
Paste the toolkit from Get the code into your page first, then call the chart like this.
const tile = (label, value, delta, goodWhen, values) =>
h('div', { class: 'kt' },
h('span', { class: 's' }, label),
h('span', { class: 'v' }, value),
h('span', { class: 'd ' + (delta === 0 ? 'flat' : (delta > 0) === (goodWhen === 'up') ? 'good' : 'bad') },
(delta > 0 ? '▲ ' : '▼ ') + Math.abs(delta) + '% vs last month'),
spark(values, { w: 160, h: 30, label: label + ' trend' }));
grid.append(tile('Spent this month', '£2,310', 6, 'down', last6));
// loading state
h('div', { class: 'kt' }, h('div', { class: 'skel', style: 'height:1.4rem;width:60%' }));Options
What you can pass to this chart.
.kgrid
A 4-column grid (2 on a phone) with 1px dividers. Children are .kt tiles.
.kt
Tile: .s label, .v value, .d change, optional spark(). Use <a class='kt'> for links.
.d
The change line. Colour by meaning with .good (green) or .bad (red). .up is red and .down is green, for measures where rising is bad such as cost. .flat is neutral grey: use it for a measure that is neither good nor bad, such as volume.
.skel
Shimmer placeholder while loading; respects prefers-reduced-motion.
More charts like this
Other charts in the “At a glance” group.
Word cloud
The words people use most, sized by how often they appear, with optional colour for rising and falling.
View chart →Data table
The accessible twin of every chart: plain numbers in a real table.
View chart →Gauge
Progress against a budget or limit, with the state spelled out in words.
View chart →Want charts or dashboards like these in your own product?
Tell me what you are trying to see and I can help work out the right approach, from the data behind it to the screen in front of people.