Dashboard
Small building blocks for operational and clinical dashboards: a metric card, a status badge, and a stepper. They are presentation-only, so they drop into any layout (pair them with Grid/Stack) and the charts.
vue
<script setup lang="ts">
import { StatCard, StatusBadge } from '@myghf/ui'
</script>
<template>
<StatCard label="Admissions" :value="128" hint="This month" :trend="12" />
<StatusBadge tone="success" label="Stable" />
</template>Admissions
128up 12 percent
This month
Avg. wait
3.4 ddown 5 percent
Occupancy
86%
StableUnder reviewCritical
- Details
- 2Payment
- 3Review
vue
<script setup lang="ts">
import { ref } from 'vue'
import { StatCard, StatusBadge, Stepper } from '@myghf/ui'
const step = ref(1)
const steps = [{ label: 'Details' }, { label: 'Payment' }, { label: 'Review' }]
</script>
<template>
<div class="grid gap-6">
<div class="grid gap-4 sm:grid-cols-3">
<StatCard label="Admissions" :value="128" hint="This month" :trend="12" />
<StatCard label="Avg. wait" value="3.4 d" :trend="-5" />
<StatCard label="Occupancy" value="86%" />
</div>
<div class="flex flex-wrap items-center gap-2">
<StatusBadge tone="success" label="Stable" />
<StatusBadge tone="warning" label="Under review" />
<StatusBadge tone="danger" label="Critical" pulse />
</div>
<Stepper :model-value="step" :steps="steps" label="Checkout" />
</div>
</template>StatCard
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | The metric name. |
value | string | number | — | The headline value. |
hint | string | — | Small text under the value. |
trend | number | — | Percentage change; its sign picks the tone (positive → success, negative → danger). |
tone | tone | 'info' | Accent tone when there is no trend. |
Slots: value, hint, and a default slot for extra content.
StatusBadge
| Prop | Type | Default | Description |
|---|---|---|---|
tone | tone | 'info' | Badge colour. |
label | string | — | Label text. Falls back to the default slot. |
pulse | boolean | false | Animate the dot for a live/active status. |
Stepper
| Prop | Type | Default | Description |
|---|---|---|---|
modelValue | number | 0 | Zero-based index of the current step. |
steps | { label: string; description?: string }[] | [] | The steps. |
label | string | 'Progress' | Accessible name for the step list. |
The default slot renders the current step's content; a step slot can override a step's label.
Accessibility
StatCardshows the trend as+12%visually andup 12 percentto screen readers (the sign/arrow arearia-hidden).StatusBadge's dot is decorative (aria-hidden); the label carries the meaning — never rely on colour alone, keep the text.Steppermarks the active step witharia-current="step"and shows a check for completed steps (the icon isaria-hidden, so the label is the announcement).
Dark mode & RTL
- All of them use semantic tokens (
bg-surface,border-border,text-muted) and the tone map, so they adapt to dark mode automatically. - Layout is logical (
gap,text-start,ms/me), so everything mirrors underdir="rtl".
