Build a stepper showcase with progress indication, step validation, icon states,…
- User
Build a stepper showcase with progress indication, step validation, icon states, vertical/horizontal layouts, and smooth transition animations.
Assistant
I'll build a comprehensive stepper showcase with all the requested features. Let me start by installing the animation library and then creating the components.
Now let me create the stepper hook and components:
Now let me create the progress bar and the main stepper component:
Now let me create the main App component that serves as the showcase:
Now let me also update the index.css with some custom animations and styles:
Now let's build the project to check for any remaining errors:
The project builds successfully! Let me verify the final file structure:
The stepper showcase is complete and built successfully. Here's what I built:
Architecture
src/hooks/useStepper.ts— Custom hook managing stepper state: step statuses (completed/active/pending/error), progress calculation, async validation, and navigationsrc/components/StepItem.tsx— Individual step indicator with animated icon states (pending numbers, active icons, completed checkmarks, error alerts) and pulsing active-ring animationsrc/components/ProgressBar.tsx— Animated connector bars with smooth fill transitions between stepssrc/components/Stepper.tsx— Orchestrator returning render functions for header, content, controls, and progress barsrc/App.tsx— Full showcase page
Features
- 3 Demo Scenarios: User Onboarding (4 steps), E-Commerce Checkout (4 steps), App Deployment (3 steps)
- Progress Indication: Animated progress bar with percentage, segment-by-segment fill, and color-coded states
- Step Validation: Async validation support with error state handling
- Icon States: Each step shows pending (number), active (icon with pulse), completed (checkmark), or error (alert icon)
- Layout Toggle: Switch between horizontal and vertical layouts dynamically
- 3 Visual Variants: Default (violet/emerald), Colorful (gradients + shadows), Minimal (monochrome)
- Smooth Animations: Framer Motion-powered transitions for step content, icon state changes, progress fills, hover/tap effects, and completion modal
- Responsive Design: Works on mobile and desktop
- Completion Modal: Celebratory animation when all steps are finished
Files built:
index.html,src/hooks/useStepper.ts,src/components/StepItem.tsx,src/components/ProgressBar.tsx,src/components/Stepper.tsx,src/App.tsx,src/index.css
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.