Skip to content

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
  1. Details
  2. 2Payment
  3. 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 ​

PropTypeDefaultDescription
labelstring—The metric name.
valuestring | number—The headline value.
hintstring—Small text under the value.
trendnumber—Percentage change; its sign picks the tone (positive → success, negative → danger).
tonetone'info'Accent tone when there is no trend.

Slots: value, hint, and a default slot for extra content.

StatusBadge ​

PropTypeDefaultDescription
tonetone'info'Badge colour.
labelstring—Label text. Falls back to the default slot.
pulsebooleanfalseAnimate the dot for a live/active status.

Stepper ​

PropTypeDefaultDescription
modelValuenumber0Zero-based index of the current step.
steps{ label: string; description?: string }[][]The steps.
labelstring'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 ​

  • StatCard shows the trend as +12% visually and up 12 percent to screen readers (the sign/arrow are aria-hidden).
  • StatusBadge's dot is decorative (aria-hidden); the label carries the meaning — never rely on colour alone, keep the text.
  • Stepper marks the active step with aria-current="step" and shows a check for completed steps (the icon is aria-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 under dir="rtl".

Released under the MIT License.