mui / mui/material-ui

[MobileStepper] Add ability to maintain the 3 dots exactly at center of the whole stepper width, whatever is the width of "Back" and "Next"

Open
#21,636 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

has workaround scope: stepper type: new feature
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

In you demo page https://material-ui.com/components/steppers/#dots you use words "Back" and "Next", plus an icon for each, so the width of these buttons are exactly the same, so we see 3 dots exactly at middle of the Stepper container.

But if you change the labels by let's say "Previous" and "Next" (or change locale of these labels), then the buttons width is not the same, and the 3 dots move a bit to the right and so they are not centered anymore with the whole Stepper container.

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

You could add an option to let developer decide if dots should:

  • current behaviour: maintain exactly the same space between:
    ** Back to 3 dots (on the left side of stepper)
    ** 3 dots to Next (on the right side of stepper)
    OR
  • new behaviour: remain always at middle of stepper

Examples 🌈

import MobileStepper from '@material-ui/core/MobileStepper';

export default function DotsCenteredMobileStepper() {

   ...

  return (
    <MobileStepper
      ...
      variant="dots"
      dotPosition="centered"
      nextButton={
        <Button ... >
          Next
        </Button>
      }
      backButton={
        <Button ... >
          Back
        </Button>
      }
    />
  );
}

Motivation 🔦

This option would help to:

  • set dot position exactly at the middle of Stepper, so in some cases it could help container design, for example to do some alignment
  • maintain position of dots if Back/Next buttons label are changing during navigation through steps

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the MobileStepper component and its variant="dots" behavior, then compare it with the dots demo linked in the issue. Review how backButton and nextButton widths affect the layout and determine the API and tests needed for centered dots. Done means the requested centered positioning works with unequal or localized button labels without changing current behavior by default.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.