File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,6 +112,10 @@ function ColorlibStepIcon(props: ColorlibStepIconPropsI) {
112112 ) ;
113113}
114114
115+ const stepLabelSlots = {
116+ stepIcon : ColorlibStepIcon
117+ } ;
118+
115119const CustomizedStepper : React . FC < CustomizedStepperPropsI > = ( {
116120 stepLabels,
117121 activeStep,
@@ -122,6 +126,13 @@ const CustomizedStepper: React.FC<CustomizedStepperPropsI> = ({
122126} ) => {
123127 const theme = useTheme ( ) ;
124128
129+ const stepLabelSlotProps = useMemo (
130+ ( ) => ( {
131+ stepIcon : { icons } as Partial < ColorlibStepIconPropsI >
132+ } ) ,
133+ [ icons ]
134+ ) ;
135+
125136 return (
126137 < Stack data-testid = { testId } >
127138 < Stack
@@ -135,12 +146,14 @@ const CustomizedStepper: React.FC<CustomizedStepperPropsI> = ({
135146 activeStep = { activeStep }
136147 connector = { < ColorlibConnector /> }
137148 data-testid = "stepper-container"
149+ sx = { { flex : 1 } }
138150 >
139151 { stepLabels . map ( ( label , index ) => (
140152 < Step key = { label } data-testid = { `step-${ index } ` } >
141153 < StyledStepLabel
142154 data-testid = { `step-label-${ index } ` }
143- StepIconComponent = { ( props ) => < ColorlibStepIcon { ...props } icons = { icons } /> }
155+ slots = { stepLabelSlots }
156+ slotProps = { stepLabelSlotProps }
144157 >
145158 { label }
146159 </ StyledStepLabel >
You can’t perform that action at this time.
0 commit comments