ConstMust be used within a Stepper context. Automatically calls setCanProceed(step, canProceed)
on mount and when canProceed changes.
export const Step: FC<
PropsWithChildren<{
step: number
canProceed?: boolean
}>
> = ({ children, step, canProceed = true }) => {
const { currentStep, setCanProceed } = useStepper()
useEffect(() => {
setCanProceed(step, canProceed)
}, [canProceed])
if (step !== currentStep) return null
return <>{children}</>
}
Renders its children only when the current step matches the provided
stepindex.Typically used inside a stepper-based flow (e.g., multistep form or wizard). Integrates with the Stepper context to set whether the step is allowed to proceed.
Example usage: