GooseUI

Components

Step Progress

New

A thin progress line for multi-step forms. The completed part is drawn with running dashes, a dot marks the current position, the counter on the left shows the step and the percentage sits on the right. It is a server component with no client JavaScript.

Preview

Profile

Installation

npx shadcn@latest add @gooseui/step-progress
pnpm dlx shadcn@latest add @gooseui/step-progress
yarn dlx shadcn@latest add @gooseui/step-progress
bunx --bun shadcn@latest add @gooseui/step-progress

Usage

import { StepProgress } from "@/components/ui/step-progress"

export default function Example() {
  return <StepProgress step={4} total={5} />
}

Examples

Counter, percentage, animation

Hide the counter or the percentage when the layout already shows them, and stop the dashes with animated={false}. With prefers-reduced-motion the dashes stand still anyway.

<StepProgress step={1} total={4} showCounter={false} />
<StepProgress step={3} total={8} showPercent={false} />
<StepProgress step={6} total={6} animated={false} />

Color

Dashes are drawn with currentColor, so a text color class on the component repaints the line.

<StepProgress step={2} total={5} className="text-primary" />
<StepProgress step={4} total={5} label="Uploading files" className="text-muted-foreground" />

Props

PropTypeDefaultDescription
stepnumber-Current step, starting from 1
totalnumber-Total number of steps
showCounterbooleantrueShow the 04 / 05 counter
showPercentbooleantrueShow the percentage
animatedbooleantrueRun the dashes on the completed part
labelstring"Step {step} of {total}"Accessible label, {step} and {total} are replaced
classNamestring-Additional CSS classes

Features

  • progressbar role: aria-valuenow in percent and a readable aria-valuetext
  • Reduced motion: the dash animation runs only under motion-safe
  • No client code: the keyframes ship in a deduplicated style tag