Stepper
A multi-step form component with smooth transitions
Configuring your account...
Please wait while we prepare everything for you
Usage
import Stepper, { Step } from '@/components/bynanaui/stepper';
import { useState } from 'react';
export default function Demo() {
const [name, setName] = useState('');
return (
<Stepper
initialStep={1}
onStepChange={(step) => console.log('Current step:', step)}
onFinalStepCompleted={() => console.log('Completed!')}
backButtonText="Previous"
nextButtonText="Next"
>
<Step>
<h2>Welcome!</h2>
<p>Let's get started with the stepper component.</p>
</Step>
<Step>
<h2>Step 2</h2>
<p>Add your custom content here.</p>
</Step>
<Step>
<h2>Enter Your Name</h2>
<input
value={name}
onChange={(e) => setName(e.target.value)}
placeholder="Your name?"
/>
</Step>
<Step>
<h2>Complete!</h2>
<p>You're all done, {name || 'friend'}!</p>
</Step>
</Stepper>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | Required | Step components |
initialStep | number | 1 | Starting step |
onStepChange | (step: number) => void | () => {} | Called when step changes |
onFinalStepCompleted | () => void | () => {} | Called when all steps complete |
backButtonText | string | 'Back' | Text for back button |
nextButtonText | string | 'Continue' | Text for next button |
disableStepIndicators | boolean | false | Disable clicking on step indicators |
Features
- Smooth Transitions: Slide animations between steps
- Progress Tracking: Visual indicators with check marks
- Step Navigation: Click on any step to jump to it
- Black & White Theme: Clean, minimal design
- Auto Height: Container adjusts to content size
- Customizable: Override button props and styles