- Accordion
- Action Bar
- Action Toast
- Alert Banner
- Alert Dialog
- Alert
- Alphabet Index
- Amount Field
- Aspect Ratio
- Attachment
- Availability List
- Avatar
- Badge
- Bank Card
- Breadcrumb
- Bubble
- Button Group
- Button
- Calendar
- Camera Frame
- Card Design Picker
- Card Details
- Card Peek
- Card Stack
- Card
- Carousel
- Chart
- Chat Thread
- Checkbox
- Chip Group
- Choice Tile
- Code Block
- Code Dots
- Collapsible
- Combobox
- Command
- Context Menu
- Copy Field
- Countdown
- Country Select
- Data Table
- Date Field
- Date Picker
- Date Range Picker
- Dialog
- Direction
- Document Paper
- Drawer
- Dropdown Menu
- Empty
- Entity Avatar
- Field
- File Trigger
- File Upload Item
- Hover Card
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Key Value
- Keypad
- Label
- Live Region
- Marker
- Message Scroller
- Message
- Money Amount
- Native Select
- Number Field
- Pagination
- Percent Split Editor
- Phone Field
- Popover
- Progress
- QR Code
- Questionnaire
- Radio Group
- Range Histogram
- Rating
- Resizable
- Scroll Area
- Search Field
- Select
- Separator
- Share Bar
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Sortable List
- Spinner
- Status Timeline
- Step Header
- Steps List
- Swipe Row
- Switch
- Table
- Tabs
- Text Field
- Textarea
- Tier Ladder
- Toggle Group
- Toggle
- Token Search Field
- Tooltip
- Trace
- Transaction Row
- Usage Meter
- Transfer created, Completed
- Money sent, Completed
- Bank is processing, In progressNowUsually takes up to 2 hours
- Received by Maya Chen, Not started
import { Card, CardContent } from "@/components/ui/card"
import {
StatusTimeline,Use a status timeline to show where a process stands, such as a transfer, a refund, a card order or an identity check. A thin rail with dots is filled up to the last finished step, and each step can carry a time, a detail and an action. Keep it to about five steps on a card or sheet. Pick a progress bar when only the share done matters, and a list of transactions when the steps are separate events.
Installation#
pnpm dlx shadcn@latest add @dots/status-timeline
Usage#
import {
StatusTimeline,
StatusTimelineItem,
} from "@/components/ui/status-timeline"<StatusTimeline aria-label="Transfer status">
<StatusTimelineItem status="done" title="Money sent" time="11:44 PM" />
<StatusTimelineItem status="current" title="Bank is processing" time="Now" />
<StatusTimelineItem status="pending" title="Received" />
</StatusTimeline>Composition#
StatusTimeline
└── StatusTimelineItem
├── title
├── description
├── children
└── timeFeatures#
- Four statuses:
done,current,pendingandfailed - A rail filled up to the last finished step
- A cross on a failed step, so it reads without color
- A
warningtone for a current step that waits on the user - The status of each step is read as text by screen readers
- Times as
<time>elements when you passdateTime - A denser
smsize for cards and sheets
Waiting for the user#
Set tone="warning" on the current step when the user has to act, and say so in statusLabel. Put the action in the step's children.
- Documents uploaded, Completed
- Selfie needed, Waiting for youThe photo was blurry. Take a new one in good light.
- Review, Not started
import { Button } from "@/components/ui/button"
import { Card, CardContent } from "@/components/ui/card"
import {Failed#
Set status="failed" on the step where the process stopped. Use the description for the reason and what to do next.
- Refund requested, Completed$48.20 from Coffee Point
- Merchant declined, FailedThe merchant says the order was delivered. You can open a dispute.
- Money returned, Not started
import { Button } from "@/components/ui/button"
import { Card, CardContent } from "@/components/ui/card"
import {Small#
Use size="sm" for a denser list inside a card or sheet.
- Ordered, CompletedOct 30
- Printed, CompletedNov 2
- On the way, In progressArrives Nov 14 to 16
- Activated, Not started
import {
StatusTimeline,
StatusTimelineItem,Accessibility#
StatusTimeline is an ordered list, and the current step has aria-current="step". The dot and the rail are decorative. Each title is followed by its status in visually hidden text: "Completed", "In progress", "Not started" or "Failed".
Name the timeline#
Give the timeline an aria-label that says what process it tracks.
<StatusTimeline aria-label="Refund status">{/* steps */}</StatusTimeline>Say what is expected#
When a step waits on the user, override the spoken status with statusLabel so it is not just "In progress".
<StatusTimelineItem
status="current"
tone="warning"
statusLabel="Waiting for you"
title="Selfie needed"
/>Machine-readable time#
Pass dateTime with an ISO date so the short time is rendered as a <time> element.
API Reference#
StatusTimeline#
The list of steps. Renders an ol and accepts all of its props.
| Prop | Type | Default | Description |
|---|---|---|---|
size | "default" | "sm" | "default" | sm is denser, for cards and sheets. |
aria-label | string | - | What process the timeline tracks. |
className | string | - | Additional classes to apply to the list. |
StatusTimelineItem#
One step. Renders an li and accepts all of its props except title.
| Prop | Type | Default | Description |
|---|---|---|---|
title | React.ReactNode | - | What the step is, such as "Payment sent". Required. |
status | "done" | "current" | "pending" | "failed" | "pending" | Whether the step has passed, is in progress, is ahead or stopped here. |
description | React.ReactNode | - | A detail, how long to wait, or for a failed step the reason. |
time | React.ReactNode | - | Short time on the right, such as "11:44 PM" or "Now". |
dateTime | string | - | Machine-readable time. When set, time is rendered as a <time> element. |
tone | "default" | "warning" | "default" | warning marks a current step that waits on the user. Current step only. |
statusLabel | string | - | Overrides the status read by screen readers, such as "Waiting for you". |
children | React.ReactNode | - | Extra content under the description, such as a button. |
className | string | - | Additional classes to apply to the step. |