Skip to content

[stepper] Include StepConnector inside Step element#48492

Merged
silviuaavram merged 2 commits intomui:masterfrom
silviuaavram:fix/stepper-markup
May 11, 2026
Merged

[stepper] Include StepConnector inside Step element#48492
silviuaavram merged 2 commits intomui:masterfrom
silviuaavram:fix/stepper-markup

Conversation

@silviuaavram
Copy link
Copy Markdown
Member

@silviuaavram silviuaavram commented May 7, 2026

Includes the StepConnector inside the Step element at all times. This is done to ensure we only have <li> elements inside the <ol> stepper element. The <div> elements from the connectors now are part of the <li>.

Updated the styles to keep the non-alternativeLabel variant the same visually.

Follow up for #48397

@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented May 7, 2026

Deploy preview

https://deploy-preview-48492--material-ui.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/material 🔺+317B(+0.06%) 🔺+69B(+0.05%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@zannager zannager added the scope: stepper Changes related to the stepper. label May 7, 2026
@silviuaavram silviuaavram marked this pull request as ready for review May 7, 2026 14:41
Copilot AI review requested due to automatic review settings May 7, 2026 14:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Material UI Stepper/Step rendering and layout so that the StepConnector is rendered inside each Step (instead of being a sibling between steps), and adjusts horizontal non-alternativeLabel spacing accordingly.

Changes:

  • Render the connector inside StepRoot for steps after the first (index !== 0).
  • Add horizontal, non-alternativeLabel layout styling to support the new connector placement (grid layout in Step, gap in Stepper).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/mui-material/src/Stepper/Stepper.js Adds gap styling for horizontal non-alternativeLabel steppers to preserve spacing with the new connector DOM placement.
packages/mui-material/src/Step/Step.js Moves connector rendering inside StepRoot and introduces hasConnector-driven styling (grid layout) for horizontal non-alternativeLabel steps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/mui-material/src/Step/Step.js
@silviuaavram silviuaavram changed the title [Stepper] Include StepConnector inside Step element [stepper] Include StepConnector inside Step element May 8, 2026
@ArmandRedgate
Copy link
Copy Markdown

ArmandRedgate commented May 8, 2026

This seems to work and I agree with the approach. Thank you for spending the time @silviuaavram ❤️.

While you're at it, could you add the missing aria-label on the progress bar example like I did in my PR? If not no worries.

@silviuaavram
Copy link
Copy Markdown
Member Author

Did that here #48494

Any reason why not adding it to the dots one as well? @ArmandRedgate

Copy link
Copy Markdown
Member

@mj12albert mj12albert left a comment

Choose a reason for hiding this comment

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

Looks good ~

@silviuaavram silviuaavram merged commit 5a94470 into mui:master May 11, 2026
18 checks passed
@silviuaavram silviuaavram deleted the fix/stepper-markup branch May 11, 2026 05:41
@ArmandRedgate
Copy link
Copy Markdown

@silviuaavram only that that was the only one that triggered my scanner. Not sure why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: stepper Changes related to the stepper.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants