- 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
- Copy the codeIt works once and expires in 12 monthsGift card codeX7KQ-92MP-4TRA
- Open the store appAccount, then Redeem gift card
- Paste the codeThe balance shows up within a minute
"use client"
import { Button } from "@/components/ui/button"The StepsList component shows numbered instructions the user follows outside the current screen: how to redeem a gift card, how to add a card to a phone wallet, or what happens after a transfer. Each step has a title, an optional description, and an optional action such as a copy or open button. It is static content; for the progress of a flow the user is in right now, use Step Header instead.
Installation#
pnpm dlx shadcn@latest add @dots/steps-list
Usage#
import { StepsList, StepsListItem } from "@/components/ui/steps-list"<StepsList aria-label="How to redeem">
<StepsListItem title="Copy the code" />
<StepsListItem
title="Open the store app"
description="Account, then Redeem gift card"
/>
<StepsListItem title="Paste the code" />
</StepsList>Composition#
Use the following composition to build a steps list:
StepsList
└── StepsListItem
├── title
├── description
├── children
└── actionFeatures#
- A real ordered list, so the order is conveyed by the markup and not only by the numbers
- Numbers in muted circles, counted by CSS and hidden from assistive tech
startto continue the numbering from an earlier list- An
actionslot at the end of each step for a copy or open button - Extra content under the description through
children, such as a copy field
Titles only#
Keep each step to a short title when the instruction needs no detail. Add a description only where the user needs to know how or where.
- Open the wallet app on your phone
- Tap Add card
- Enter the card detailsCopy them from the Cards screen
- Confirm with the code we text you
import { StepsList, StepsListItem } from "@/components/ui/steps-list"
export function StepsListTitles() {Action and content#
Pass a control to action to place it at the end of the step, for example a button that opens another app. Put extra content such as a Copy Field in children; it renders under the description. See the demo at the top of this page.
<StepsListItem
title="Open the store app"
description="Account, then Redeem gift card"
action={
<Button size="sm" variant="secondary">
Open
</Button>
}
/>Start#
Set start to continue the numbering, for example when the steps are split across two sections of a screen.
- Wait for the money to arriveUsually within one business day
- Check your balanceThe amount shows up in USD
import { StepsList, StepsListItem } from "@/components/ui/steps-list"
export function StepsListStart() {Accessibility#
StepsList renders an <ol> with role="list", so Safari keeps list semantics after list-style: none. Screen readers announce the number of steps and the position of each one. The number circles are aria-hidden, so the number is not read twice.
Label the list#
When the list has no visible heading right above it, give it an aria-label such as "How to redeem". When it does, point aria-labelledby at the heading instead.
Label actions#
The action is your own control. Give it text or an aria-label that names the target, such as "Copy gift card code", when the step title alone does not make it clear.
API Reference#
StepsList#
The ordered list.
| Prop | Type | Default | Description |
|---|---|---|---|
start | number | - | The number of the first step. Shifts the visible numbers too. |
className | string | - | Additional classes to apply to the list. |
...props | Omit<React.ComponentProps<"ol">, "reversed" | "type"> | - | Props spread to the <ol>. |
reversed and type are left out on purpose: the numbers are a CSS counter that follows start only.
StepsListItem#
One step: a number in a muted circle, the instruction, and an optional action.
| Prop | Type | Default | Description |
|---|---|---|---|
title | React.ReactNode | - | What to do, such as "Open the store app". Required. |
description | React.ReactNode | - | How or where, such as "Settings, then Redeem gift card". |
action | React.ReactNode | - | A control at the end of the step, such as a copy button. |
children | React.ReactNode | - | Extra content under the description, such as a copy field. |
className | string | - | Additional classes to apply to the <li>. |
...props | Omit<React.ComponentProps<"li">, "title" | "children"> | - | Props spread to the <li>. |