Stepper Component
Watch the walkthrough
Open on InstagramExercise: Build a configurable stepper
Given an ordered array of steps with IDs, labels, and content, render a progress indicator and the active panel. Provide Previous and Next controls, and a completion action on the final step.
Requirements
- Keep one active index and derive completed/active/upcoming indicators from it.
- Disable Previous at the first step and guard the final boundary.
- Validate the current step before advancing; preserve entered values when navigating back.
- Handle zero or one step without dividing by zero; mark the active step with aria-current="step".
Acceptance checks and discussion
Navigate through every step, fail validation, then correct it and continue. Verify back navigation retains form values. Make an explicit choice about whether users can click ahead in the progress indicator.
The brief above is an original practice specification. The linked sandbox is supporting solution material and may implement a simpler subset of these requirements.