Timeline
Timeline renders a chronological activity list: a labelled <ol> of TimelineItems. Each item is a bullet with a title, an optional timestamp, and a body, and consecutive bullets are joined by a vertical line so the sequence reads as one continuous trail.
vue
<script setup lang="ts">
import { Timeline, TimelineItem } from '@myghf/ui'
</script>
<template>
<Timeline label="Admission">
<TimelineItem title="Admitted" time="09:15" tone="success">Triage complete.</TimelineItem>
<TimelineItem title="Transferred to ward" time="11:40">Bed 12 assigned.</TimelineItem>
</Timeline>
</template>Examples
- AdmittedTriage complete.
- Transferred to wardBed 12 assigned.
- Scheduled for dischargePaperwork pending.
vue
<script setup lang="ts">
import { Timeline, TimelineItem } from '@myghf/ui'
</script>
<template>
<div class="max-w-md">
<Timeline label="Admission">
<TimelineItem title="Admitted" time="09:15" tone="success">Triage complete.</TimelineItem>
<TimelineItem title="Transferred to ward" time="11:40">Bed 12 assigned.</TimelineItem>
<TimelineItem title="Scheduled for discharge" time="15:05">Paperwork pending.</TimelineItem>
</Timeline>
</div>
</template>The line is drawn automatically between items and stops after the last bullet — there is nothing to configure.
Props
Timeline prop | Type | Default | Description |
|---|---|---|---|
label | string | 'Activity' | Accessible name for the list. |
TimelineItem prop | Type | Default | Description |
|---|---|---|---|
title | string | — | Event title. Falls back to the title slot. |
time | string | — | Timestamp shown next to the title. |
tone | tone | 'info' | Marker colour. |
The TimelineItem default slot is the event body.
Events
None.
Slots
Timelinerenders itsTimelineItemchildren.TimelineItem:title(event title) and the default slot (event body).
Exposed methods
None. Timeline does not call defineExpose.
Accessibility
Timelineis a labelled<ol>; thelabelprop becomes itsaria-label, so the list announces as a set of events with a name.TimelineItemmarks the timestamp up as<time>so assistive tech can read it as a date.- The connecting line is a decorative pseudo-element; it never appears in the accessibility tree, and the list structure already conveys the order.
Dark mode & RTL
- The line uses the
bordertoken and the markers use the tone map, so both follow the dark theme through the shared tokens. - The line is positioned with the logical
startutility and spacing usesgap, so the whole trail mirrors underdir="rtl".
