Skip to content

fix(Stepper): use slots API for custom step icons and fix alignment (MUI v9)#1563

Merged
banana-three-join merged 5 commits into
layer5io:masterfrom
Rajesh-Nagarajan-11:fix-stepper
May 19, 2026
Merged

fix(Stepper): use slots API for custom step icons and fix alignment (MUI v9)#1563
banana-three-join merged 5 commits into
layer5io:masterfrom
Rajesh-Nagarajan-11:fix-stepper

Conversation

@Rajesh-Nagarajan-11
Copy link
Copy Markdown
Member

@Rajesh-Nagarajan-11 Rajesh-Nagarajan-11 commented May 19, 2026

Root Cause:

  • Missing Icons: MUI v9 deprecated the StepIconComponent prop on StepLabel and replaced it with the slots/slotProps API. The old prop is silently ignored, causing the stepper to fall back to default numbered circles.
  • Misalignment: For accessibility, MUI v9 changed the component to render as an <ol> element instead of a <div> Because of this, it no longer defaults to a full-width block-level element, causing the stepper to shrink and misalign to the left.

Fix:

  • Replaced StepIconComponent with slots={{ stepIcon: ColorlibStepIcon }} and passed the icons array via slotProps.
  • Added sx={{ flex: 1 }} to the so it naturally grows to fill the flexbox container, accounting for the <div> to <ol> DOM change and restoring proper centering.

Screenshots

Before After
before after

Signed commits

  • Yes, I signed my commits.

Rajesh-Nagarajan-11 and others added 3 commits May 19, 2026 20:44
Signed-off-by: Rajesh-Nagarajan-11 <rajeshnagarajan36@gmail.com>
Signed-off-by: Rajesh-Nagarajan-11 <rajeshnagarajan36@gmail.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the CustomizedStepper component to utilize the slots and slotProps API for StyledStepLabel and adds a flex style to the stepper container. A review comment suggests optimizing performance by moving the slots object outside the component and memoizing slotProps to avoid redundant re-renders caused by inline object creation within the mapping function.

Comment thread src/custom/Stepper/index.tsx Outdated
…ization

Signed-off-by: Rajesh-Nagarajan-11 <rajeshnagarajan36@gmail.com>
Copy link
Copy Markdown
Member

@Sbragul26 Sbragul26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@rishiraj38
Copy link
Copy Markdown
Member

LGTM !!!!!!

Copy link
Copy Markdown
Contributor

@banana-three-join banana-three-join left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@banana-three-join banana-three-join merged commit a728eb9 into layer5io:master May 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants