Hooks
useStep

Import this in your client-side component

MyComponent.tsx
import { useStep } from "react-amazing-hooks";
ApiDescriptionTypeReturn TypeExample
stepCurrent step value.numbernumber1
maxStepMaximum allowed step (if set).number | undefinednumber | undefined10
minStepMinimum allowed step.numbernumber0
nextMove to the next step, clamped at maxStep.() => voidvoidnext()
prevMove to the previous step, clamped at minStep.() => voidvoidprev()
resetReset step to initial value (clamped within limits).() => voidvoidreset()
setSet step to a specific value, clamped within limits.(value: number) => voidvoidset(2)
canGoNextBoolean indicating if next step is available.booleanbooleanNote*
canGoPrevBoolean indicating if previous step is available.booleanbooleanNote*

Check the UseStepOptions interface in the 'Types' tab.

Check the 'Example' tab above the table for an exhaustive example. *