Wizard steps
Wizard progress with numbered nodes joined by pixel lines that fill as you advance; finished steps show a check and lead back on click.
Playground
Change a prop and the component re-renders. Props marked remounts set an initial value, so the component starts over.
<PxSteps
steps={[
"Details",
"Billing",
"Review",
"Done"
]}
defaultStep={2}
controls
/>Installation
pnpm dlx shadcn@latest add @lumesec/px-stepsFirst timeRegister the @lumesec registry once, or install by URL+
Adds @lumesec to your components.json:
pnpm dlx shadcn@latest registry add @lumesec=https://elements.lumesec.ai/r/{name}.jsonOr skip the setup and install by URL:
npx shadcn@latest add https://elements.lumesec.ai/r/px-steps.jsonUsage
import { PxSteps } from "@/components/lumesec/px-steps";
export function Example() {
return <PxSteps steps={["Details", "Billing", "Review", "Done"]} defaultStep={2} controls />;
}Behaviour
Numbered nodes joined by pixel lines that fill as you advance. Finished steps show a check and can be clicked to go back.
API reference
Props
Also accepts every prop of <div> (React.ComponentProps<"div">), spread onto the root element.
stepTypenumberControlled current step, from 1. One more than the number of steps marks the flow complete. Rounded and clamped. Use with onStepChange.
defaultStepTypenumberDefault1Initial step when uncontrolled.
stepsTypereadonly string[]Default["Details", "Billing", "Review", "Done"]Step names, in order.
controlsTypebooleanDefaultfalseShows Back and Continue buttons; Continue reads Finish on the last step.
onStepChangeType(step: number) => voidCalled with the new step when the user moves: Back, Continue, Finish or a click on a finished step. Completing the flow reports the number of steps plus one.
onCompleteType() => voidCalled when the user moves past the last step.
Ref
ref points at the root HTMLDivElement.
Accessibility
- Step names are native buttons in an ordered list, each with an
aria-labelsuch as "Billing, step 2 of 4", plus ", done" for finished steps. The current one hasaria-current="step". - Only finished steps act on click; the others are still focusable buttons.
- The node graphic is an
aria-hiddencanvas. The step numbers over it arearia-hiddentext, because each button'saria-labelalready carries the number. - Back is disabled on step 1, and Continue is disabled once the flow is complete.
- Reduced motion: the connecting lines fill at once, the current step does not pulse and no sparks fire on completion.
Theming
Styled with Tailwind classes on your shadcn theme tokens, so light and dark follow your theme. The accent comes from --lumesec. See Theming.
This component reads --lumesec, --lumesec-shine, --lumesec-success, --foreground, --muted-foreground, --card, --border and --muted.
Notes
- Without reduced motion the pulse around the current step animates continuously while the steps are on screen.
- Moving past the last step, from the buttons or a controlled
step, throws sparks from every node. - The Back, Continue and Finish labels are in English.
Related
Was this page helpful?