The active step index
Stepper
A stepper component is used to indicate progress through a multi-step process.
Theming#
The Stepper
component is a multipart component. The styling needs to be
applied to each part specifically.
Anatomy#
The Stepper theming is made up of the following parts:
stepper
: Maps to theStepper
componentstep
: Maps to theStep
componenttitle
: Maps to theStepTitle
componentdescription
: Maps to theStepDescription
componentindicator
: Maps to theStepIndicator
componentseparator
: Maps to theStepSeparator
componenticon
: Maps to theStepIcon
componentnumber
: Maps to theStepNumber
component
Customizing a component#
Let's say we want to override the step indicator to use a square instead of a circle. Here's how we'll go about that:
// themes/stepper.tsconst baseStyle = {// select the indicator partindicator: {// change the default border radius to 0borderRadius: 0,},}const stepperTheme = {baseStyle,}const theme = extendTheme({components: {Stepper: stepperTheme,},})
Changing the styles for a specific size#
In addition to the baseStyle
, you can also change the styles for a specific
size. Let's say we want to change the step title's font size for the lg
size.
// themes/stepper.tsconst baseStyle = {indicator: {borderRadius: 0,},}const sizes = {lg: {// select the title parttitle: {// change the font size to lgfontSize: 'lg',},},}const stepperTheme = {baseStyle,sizes,}const theme = extendTheme({components: {Stepper: stepperTheme,},})
The styling for a stepper component can be overriden at any level, whether it's
variant
or size
, it's completely up to you.
To learn more about styling multipart components, visit the Component Style page.
Props#
Stepper Props#
index
Required
index
Required
number
children
children
The children of the stepper. Must be Step
components
ReactElement[]
StepStatus Props#
complete
complete
The element to show when the step is complete
React.ReactNode | ((props: StepContext) => React.ReactNode)
incomplete
incomplete
The element to show when the step is incomplete
React.ReactNode | ((props: StepContext) => React.ReactNode)
active
active
The element to show when the step is current
React.ReactNode | ((props: StepContext) => React.ReactNode)
All other components are passed through to their underlying components.
Theming#
The Stepper
component is a multipart component. The styling needs to be
applied to each part specifically.
Anatomy#
The Stepper theming is made up of the following parts:
stepper
: Maps to theStepper
componentstep
: Maps to theStep
componenttitle
: Maps to theStepTitle
componentdescription
: Maps to theStepDescription
componentindicator
: Maps to theStepIndicator
componentseparator
: Maps to theStepSeparator
componenticon
: Maps to theStepIcon
componentnumber
: Maps to theStepNumber
component
Customizing a component#
Let's say we want to override the step indicator to use a square instead of a circle. Here's how we'll go about that:
// themes/stepper.tsconst baseStyle = {// select the indicator partindicator: {// change the default border radius to 0borderRadius: 0,},}const stepperTheme = {baseStyle,}const theme = extendTheme({components: {Stepper: stepperTheme,},})
Changing the styles for a specific size#
In addition to the baseStyle
, you can also change the styles for a specific
size. Let's say we want to change the step title's font size for the lg
size.
// themes/stepper.tsconst baseStyle = {indicator: {borderRadius: 0,},}const sizes = {lg: {// select the title parttitle: {// change the font size to lgfontSize: 'lg',},},}const stepperTheme = {baseStyle,sizes,}const theme = extendTheme({components: {Stepper: stepperTheme,},})
The styling for a stepper component can be overriden at any level, whether it's
variant
or size
, it's completely up to you.
To learn more about styling multipart components, visit the Component Style page.