Patterns · Dashboard
StatTile
A white tile with a label, one value and a line of context. Put four in a row under the HealthBand to show backup, update, virus and uptime status at a glance.
import { StatTile } from '@statix/ui/stat-tile';Playground
Last backup
Today, 03:10
30 backups, up to 30 days back
<StatTile />Examples
Basic
Label, value and note. The note is optional.
Last backup
Today, 03:10
30 backups, up to 30 days back
WordPress
Up to date
<script lang="ts">
import { StatTile } from '@statix/ui/stat-tile';
</script>
<div class="grid w-full max-w-lg gap-4 sm:grid-cols-2">
<StatTile label="Last backup" value="Today, 03:10" note="30 backups, up to 30 days back" />
<StatTile label="WordPress" value="Up to date" />
</div>Status row
Four tiles in a grid on the page background. They collapse to two columns on tablets and one on phones.
Last backup
Today, 03:10
30 backups, up to 30 days back
WordPress
Up to date
All 6 plugins are up to date
Virus scan
No viruses
Checked today 02:40, nothing found
Uptime
100 %
No outages in 30 days, loads in 1.2 seconds
<script lang="ts">
import { StatTile } from '@statix/ui/stat-tile';
const stats = [
{ label: 'Last backup', value: 'Today, 03:10', note: '30 backups, up to 30 days back' },
{ label: 'WordPress', value: 'Up to date', note: 'All 6 plugins are up to date' },
{ label: 'Virus scan', value: 'No viruses', note: 'Checked today 02:40, nothing found' },
{ label: 'Uptime', value: '100 %', note: 'No outages in 30 days, loads in 1.2 seconds' }
];
</script>
<div class="grid gap-6 p-6 sm:grid-cols-2 tablet:p-10 lg:grid-cols-4">
{#each stats as stat (stat.label)}
<StatTile {...stat} />
{/each}
</div>With a status dot
Set status when a value needs attention. Give the dot a statusLabel so screen readers hear it too.
OK: Uptime
100 %
No outages in 30 days
Check: Certificate
6 days left
Renews on its own on 24 Nov
<script lang="ts">
import { StatTile } from '@statix/ui/stat-tile';
</script>
<div class="grid w-full max-w-lg gap-4 sm:grid-cols-2">
<StatTile
label="Uptime"
value="100 %"
note="No outages in 30 days"
status="success"
statusLabel="OK"
/>
<StatTile
label="Certificate"
value="6 days left"
note="Renews on its own on 24 Nov"
status="warning"
statusLabel="Check"
/>
</div>Small size
size="sm" for the two-column grid inside the mobile HealthBand.
Last backup
Today, 03:10
30 backups
WordPress
Up to date
All plugins current
Virus scan
No viruses
Checked 02:40
Uptime
100 %
No outages
<script lang="ts">
import { StatTile } from '@statix/ui/stat-tile';
</script>
<div class="grid w-full max-w-[342px] grid-cols-2 gap-3">
<StatTile size="sm" label="Last backup" value="Today, 03:10" note="30 backups" />
<StatTile size="sm" label="WordPress" value="Up to date" note="All plugins current" />
<StatTile size="sm" label="Virus scan" value="No viruses" note="Checked 02:40" />
<StatTile size="sm" label="Uptime" value="100 %" note="No outages" />
</div>Guidelines
Do
- Keep values short: "Today, 03:10", "Up to date", "100 %".
- Use the note for the proof behind the value, for example "Checked today 02:40, nothing found".
- Show tiles in groups of two or four so the grid stays even.
Don't
- Don’t put actions inside a tile. Link to details with an ActionTile or BigAction instead.
- Don’t colour the value. The status dot carries the state.
Accessibility
- Renders plain paragraphs in reading order: label, value, note.
- The status dot is decorative. statusLabel adds visually hidden text before the label, for example "Check: Certificate".
API reference
StatTile
renders<div> and accepts its attributes| Prop | Type | Default |
|---|---|---|
label * | string What the value is about. | – |
value * | string The value itself. | – |
note | string One line of context under the value. | – |
size | 'md' | 'sm' md for desktop grids (24px value), sm for mobile grids (17px value). | 'md' |
status | 'none' | 'success' | 'warning' | 'destructive' Adds a coloured dot before the label. | 'none' |
statusLabel | string Visually hidden text for the status dot. | – |
children | Snippet Extra content under the note. | – |
ref bind | HTMLDivElement | null The root element. | – |
class | ClassValue Merged with the tile classes; yours win. | – |
| Data attribute | Meaning |
|---|---|
data-slot="stat-tile" | Root. Parts use stat-tile-label, -value, -note. |
data-status | The current status. |