React Stepper Component API
Stepper API
Explore the API reference for the React Stepper component and discover how to effectively utilize its props for customization.
CStepper#
import { CStepper } from '@coreui/react'// orimport CStepper from '@coreui/react/src/components/stepper/CStepper'
Property | Default | Type |
---|---|---|
activeStepIndex# | - | number |
Controls the currently active step in the React Stepper component (Controlled mode). Use this prop when you want full control over the active step from the parent component. | ||
className# | - | string |
Custom CSS class name applied to the main React Stepper container. | ||
defaultActiveStepIndex# | 0 | number |
Sets the initial active step index for the Form Wizard when the React Stepper is used in Uncontrolled mode. Useful when you want the Stepper to manage its own state internally. | ||
layout# | horizontal | 'horizontal' , 'vertical' |
Defines the overall layout orientation of the React Stepper component.
Choose | ||
linear# | true | boolean |
Defines whether the Stepper enforces linear progression (cannot skip steps).
| ||
onFinish# | - | () => void |
Callback fired when the user completes the last step of the Form Wizard. Use this to trigger a submit action or redirect after the final step. | ||
onReset# | - | () => void |
Callback fired when the user triggers the reset action on the React Stepper. Use this to reset the Stepper state or clear related form data. | ||
onStepChange# | - | (stepNumber: number) => void |
Callback fired when the active step changes in the React Stepper component. | ||
onStepValidationComplete# | - | ({ stepNumber, isValid }: StepperStepValidationResult) => void |
Callback fired after a validation check completes for a specific step in the Form Wizard. Receives an object with the step index and the validation result ( Useful for custom validation handling across multi-step forms. | ||
stepButtonLayout# | horizontal | 'horizontal' , 'vertical' |
Controls the internal layout of the step indicator (icon and label) inside each step when using a horizontal layout.
This prop has no effect when | ||
steps# | [] | StepperStepData[] |
Defines the steps for the React Sxtepper component. Each step is an object containing a label, optional content, and an optional | ||
validation# | true | boolean |
Enables or disables built-in form validation inside the React Stepper. When enabled ( Requires each step to provide a |