Progress List
Installation
Add the component with the CLI.
npx shadcn@latest add @intentui/progress-list
Manual installation
Install the dependencies, then copy the component source into your project.
npm install react-aria-components @heroicons/react cn
Anatomy
import { ProgressList, ProgressListItem } from "@/components/ui/progress-list"<ProgressList aria-label="Insurance Claim" selectedKey="details">
<ProgressListItem id="policy">Policy</ProgressListItem>
<ProgressListItem id="incident">Incident</ProgressListItem>
<ProgressListItem id="details">Details</ProgressListItem>
<ProgressListItem id="documents">Documents</ProgressListItem>
<ProgressListItem id="submit">Submit</ProgressListItem>
</ProgressList>Each item needs a unique id, and selectedKey must match the current item’s id. Steps before it are shown as completed; steps after it are upcoming. Give the list an accessible label with aria-label or aria-labelledby.
Examples
Collection
Use the items prop and a render function to create progress steps from a data collection.
Controlled
Keep the current step in state and update selectedKey as the user moves through the process.
Component API
ProgressList
ProgressList extends the React Aria Components <ProgressList> component.
selectedKeyKeyclassNamestringSee React Aria for the full ProgressList API, including collection and accessibility props.
ProgressListItem
ProgressListItem extends the React Aria Components <ProgressListItem> component.
idKeyclassNamestringSee React Aria for the full ProgressListItem API.
