Dashboard and StatCard
StatCard can also be a link or a button: href (with linkComponent / linkProp for a router) or onClick makes the whole tile clickable. icon sits top right, status adds a small chip coloured by statusTone, disabled marks a restricted tile, and loading shows a placeholder for the value.
Lair overview
Last 30 days
Mischief
Banana share
- Kevin: 3 (60%)
- Stuart: 2 (40%)
- Kevin
- Stuart
Props
Dashboard
titleReactNodePage title.
subtitleReactNodeText under the title.
actionsReactNodeHeader actions.
stats{ label, value, delta?, trend?, hint? }[]Default:[]Stat tiles.
columns1 | 2 | 3Default:2Columns of the panel grid.
childrenReactNodePanels.
| Prop | Type | Default | Description |
|---|---|---|---|
title | ReactNode | – | Page title. |
subtitle | ReactNode | – | Text under the title. |
actions | ReactNode | – | Header actions. |
stats | { label, value, delta?, trend?, hint? }[] | [] | Stat tiles. |
columns | 1 | 2 | 3 | 2 | Columns of the panel grid. |
children | ReactNode | – | Panels. |
StatCard
iconReactNodeIcon shown at the top right.
statusReactNodeSmall status Chip under the value.
statusTone'default' | ToneDefault:defaultColour of the status Chip.
hrefstringMakes the whole tile a link.
linkComponentElementTypeDefault:aComponent used for the link, e.g. a router Link.
linkPropstringDefault:hrefName of the destination prop on
linkComponent.onClickMouseEventHandlerMakes the tile a button (also runs on a link).
disabledbooleanDefault:falseUnavailable tile: dimmed, not clickable,
aria-disabled.loadingbooleanDefault:falseShows a placeholder instead of the value and sets
aria-busy.size'default' | 'compact'Default:'default'Compact puts the value beside the label in a shorter tile.
labelstringMetric name.
valueReactNodeMetric value.
deltastringChange shown beside the value.
trend'up' | 'down' | 'flat'Default:'flat'Colors the delta.
hintstringSmall text below.
classNamestringDefault:''Extra classes for the root element.
| Prop | Type | Default | Description |
|---|---|---|---|
icon | ReactNode | – | Icon shown at the top right. |
status | ReactNode | – | Small status Chip under the value. |
statusTone | 'default' | Tone | default | Colour of the status Chip. |
href | string | – | Makes the whole tile a link. |
linkComponent | ElementType | a | Component used for the link, e.g. a router Link. |
linkProp | string | href | Name of the destination prop on linkComponent. |
onClick | MouseEventHandler | – | Makes the tile a button (also runs on a link). |
disabled | boolean | false | Unavailable tile: dimmed, not clickable, aria-disabled. |
loading | boolean | false | Shows a placeholder instead of the value and sets aria-busy. |
size | 'default' | 'compact' | 'default' | Compact puts the value beside the label in a shorter tile. |
label | string | – | Metric name. |
value | ReactNode | – | Metric value. |
delta | string | – | Change shown beside the value. |
trend | 'up' | 'down' | 'flat' | 'flat' | Colors the delta. |
hint | string | – | Small text below. |
className | string | '' | Extra classes for the root element. |