useStep
Custom hook that manages and navigates between steps in a multi-step process.
Installation
npx sse-hooks add use-step
yarn dlx sse-hooks add use-step
pnpm dlx sse-hooks add use-step
deno run -A npm:sse-hooks add use-step
bunx sse-hooks add use-step
Usage
example.ts
import { useStep } from "./{hooks file}";
const [
currentStep,
{
goToNextStep,
goToPrevStep,
reset,
canGoToNextStep,
canGoToPrevStep,
setStep,
},
] = useStep(3);
// Access and use the current step and provided helper functions.
API
Parameters
| Prop | Default | Type |
|---|---|---|
maxStep | - |
The maximum step in the process. |
Returns
| Return Value | Default | Type |
|---|---|---|
[0] | - |
|
[1] | - |
|
Types Aliases
No specific type aliases defined for this component.