Skip to content

Timeline

Download .md

A timeline lists the history of a record, newest first, such as the status changes of a clearance or the activity on a contract.

  • Use it for history: status changes, approvals, uploads, comments.
  • Put the newest event on top.
  • For recent events, show a relative time (“2 jam lalu”) and put the full date in dateTime and title; older events show the date.
  • For the steps still ahead, use a Stepper.
React
  1. Disetujui

    Lisensi cover siap dipakai.

  2. Ditinjau

    Tim kami memeriksa dokumenmu.

  3. Dokumen diterima

    Surat kuasa dan master audio lengkap.

  4. Diajukan

    Kamu mengajukan clearance.

Vue
  1. Disetujui

    Lisensi cover siap dipakai.

  2. Ditinjau

    Tim kami memeriksa dokumenmu.

  3. Dokumen diterima

    Surat kuasa dan master audio lengkap.

  4. Diajukan

    Kamu mengajukan clearance.

1234
  1. 1Latest event
  2. 2Event dot
  3. 3Connector
  4. 4Title and time

An ordered list. Each event has a dot, a line to the next event, the time, a title and an optional description.

Part Style
Dot 10px (size-2.5), rounded-full. primary by default; success, warning, destructive or muted-foreground by status.
Line 1px (w-px), border
Time text-xs, muted-foreground, in a <time> element
Title text-sm, font-medium
Description text-sm, muted-foreground
React Vue Flutter Type Default Use
TimelineItem status :status dot color from the theme default | success | warning | destructive | muted default The dot’s color.
TimelineTime dateTime datetime Text text none The machine-readable time of the event.
TimelineTitle, TimelineDescription same Text text none What happened.

shadcn_ui has no timeline; the Flutter snippet draws the dots and lines from the theme.

import { Timeline, TimelineDescription, TimelineItem, TimelineTime, TimelineTitle } from "@/components/ui/timeline"
const events = [
{ status: "success", title: "Disetujui", time: "2026-11-12T14:20", label: "12 Nov 2026, 14.20", text: "Lisensi cover siap dipakai." },
{ status: "default", title: "Ditinjau", time: "2026-11-10T10:05", label: "10 Nov 2026, 10.05", text: "Tim kami memeriksa dokumenmu." },
{ status: "default", title: "Dokumen diterima", time: "2026-11-08T16:40", label: "8 Nov 2026, 16.40", text: "Surat kuasa dan master audio lengkap." },
{ status: "muted", title: "Diajukan", time: "2026-11-05T09:12", label: "5 Nov 2026, 09.12", text: "Kamu mengajukan clearance." },
] as const
export default function TimelineDemo() {
return (
<Timeline aria-label="Riwayat clearance Senja di Kota" className="w-full max-w-sm">
{events.map((e) => (
<TimelineItem key={e.title} status={e.status}>
<TimelineTime dateTime={e.time}>{e.label}</TimelineTime>
<TimelineTitle>{e.title}</TimelineTitle>
<TimelineDescription>{e.text}</TimelineDescription>
</TimelineItem>
))}
</Timeline>
)
}
Terminal window
npx shadcn@latest add https://design.sosialoka.tech/r/react/timeline.json
  • It is a list; give it a name with aria-label, such as “Riwayat clearance Senja di Kota”.
  • The title says what happened, so the dot’s color is never the only signal.
  • The dots and lines are hidden from screen readers. In Flutter, each event is one Semantics node with its title, time and text.