Skip to content

KPI card

One number that matters, with its change, a sparkline you can hover and a line of context.

CSS + mian.js JSON Markdown Registry item

KPI row

Monthly recurring revenue
€48,210

6.4% increasevs last month

Active customers
1,284

38 morenew this month

Churn
2.1%

0.3 pts higher, which is worsevs last month

Installation

Everything ships in one stylesheet and one small script. There is nothing to import per component.

<link rel="stylesheet" href="https://mian.ro/dist/mian.css">
<script src="https://mian.ro/dist/mian.js" defer></script>

Prefer to own the files? /r/kpi.json is a registry item with this component's CSS and example markup, ready to copy into your project with any tool that reads the open registry-item format.

Class reference

Class / attributeDescription
mn-kpisA responsive row of KPI cards.
mn-kpiOne card. Add mn-card for the noodle’s surface.
mn-kpi-headLabel row; may end with an icon or a menu.
mn-kpi-rowThe value and the sparkline, side by side.
mn-kpi-valueThe number. Add data-mn-count to count up once when first seen.
mn-kpi-footChange and context: a mn-stat-delta and a few words.
mn-sparkOn an svg.mn-chart-line: a sparkline without grid or points. mn-up / mn-down colour it; hover, touch and arrow keys show each value. data-labels and data-unit work as on charts.

Accessibility

  • Say what the change is compared with (“vs last month”); an arrow alone is not information.
  • The sparkline is role="img" with an aria-label; its values are reachable with the arrow keys.
  • Up is not always good: colour the delta by meaning (churn going up is mn-down).
  • Counting up never replaces the text: the final value stays in the DOM.
Choose a noodle

Minimal

Flat

Pixel

Linear

Thin

Glass

Textured

Bold

Elegant

Rounded

On this page