Examples
Current and completed steps
Current progress is derived from the feature's active step index.
- Account
Add a workspace owner.
Complete - Workspace
Choose a name and region.
Current step - Review
Confirm the setup details.
Not started
Workspace setup steps
import { Steps, type StepItem } from "@phuctech/ui/components/steps";
const setupSteps: StepItem[] = [
{ title: "Account", description: "Add a workspace owner." },
{ title: "Workspace", description: "Choose a name and region." },
{ title: "Review", description: "Confirm the setup details." },
];
export function Example() {
return <Steps aria-label="Workspace setup" items={setupSteps} currentStep={1} />;
}
Error and unavailable steps
Use explicit statuses when a step needs attention or cannot be reached yet.
- Choose file
Select a CSV file.
Complete - Map columns
Two columns need attention.
Needs attention - Import
Continue when mapping is complete.
Unavailable
Import steps with error and disabled statuses
import { Steps, type StepItem } from "@phuctech/ui/components/steps";
const importSteps: StepItem[] = [
{ title: "Choose file", description: "Select a CSV file.", status: "finish" },
{ title: "Map columns", description: "Two columns need attention.", status: "error" },
{ title: "Import", description: "Continue when mapping is complete.", status: "disabled" },
];
export function Example() {
return <Steps aria-label="Import progress" items={importSteps} currentStep={1} orientation="vertical" />;
}
Try the progress
Compare the current index and orientation with the same three-step fixture.
- Account
Owner and sign-in details.
Complete - Workspace
Name and default region.
Current step - Review
Confirm before finishing.
Not started
Steps property playground
import { Steps, type StepItem } from "@phuctech/ui/components/steps";
const accountSteps: StepItem[] = [
{ title: "Account", description: "Owner and sign-in details." },
{ title: "Workspace", description: "Name and default region." },
{ title: "Review", description: "Confirm before finishing." },
];
export function Example() {
return <Steps aria-label="Account setup" items={accountSteps} currentStep={1} orientation="horizontal" />;
}
When to use
Use Steps to orient people in a task with a meaningful order and a known next stage. Use Tabs for peer views that can be revisited independently. Steps is presentational; the surrounding feature decides when a stage is valid or complete.
Usage
import { Steps, type StepItem } from "@phuctech/ui/components/steps";
const steps: StepItem[] = [
{ title: "Account" },
{ title: "Workspace" },
{ title: "Review" },
];
<Steps aria-label="Workspace setup" items={steps} currentStep={1} />The zero-based currentStep derives earlier items as complete, the matching item as current, and later items as waiting. Each item may provide an explicit status to show an error or unavailable stage. A horizontal list stacks its items vertically below the 640px small breakpoint to keep step content inside narrow viewports; on larger screens it remains horizontal and can scroll when its items exceed the available width.
States
finishmarks a completed stage.processmarks the current stage and exposesaria-current="step".waitmarks a future stage.erroranddisabledare explicit item statuses; include visible explanatory text in the item description or nearby feature content.
API
Tokens
Accessibility
Steps renders an ordered list. The active index has aria-current="step"; each state also has a visually hidden text label, so meaning does not depend on color or the marker alone. Supply a list name with aria-label.
Do and don’t
Keep status and completion connected to the actual feature flow.
Use Steps as navigation when stages are independent pages or tabs.