◾ Stepper-js ◽
Stepper-js is a little hook that provides everything you need to build an awesome stepper component or any step-by-step guided flow in React.
Explore the API »
Installation
Install the NPM package:
- Using yarn
yarn add @ndozhh/stepper-js
- Using npm
npm install @ndozhh/stepper-js
Usage
This example is built using MUI components
See the example code here
API
Property | Type | Description |
---|---|---|
currentStep |
number |
Current step of the stepper (zero based) |
isFirstStep |
boolean |
Indicates whether the stepper is in the first step |
isLastStep |
boolean |
Indicates whether the stepper is in the last step |
isFinished |
boolean |
Indicates whether the stepper is completed |
isCurrentStep |
(stepIndex: number) => boolean |
Check if a given index is the current step |
isStepCompleted |
(stepIndex: number) => boolean |
Check if a given index has been completed |
isStepSkipped |
(stepIndex: number) => boolean |
Check if a given index has been skipped |
onNext |
() => void |
Go to the next step |
onPrevious |
() => void |
Go to the previous step |
onStep |
(stepIndex: number) => void |
Go to the provided step |
onSkip |
(stepIndex: number) => void |
Skip the given step |
onReset |
() => void |
Reset the stepper to its initial state |
License
Distributed under the MIT License. See LICENSE
for more information.