How to change the numbers in steps of material ui stepper
See original GitHub issueI asked the question: https://stackoverflow.com/q/51492162/5946125
Steps takes the numbers which are length of the steps state array ex:
state = {
steps: [0, 1, 2, 3]
};
Later this state may change to :
this.setState({
steps: [1,2,3,4]
});
Or
this.setState({
steps: [2,3,4,5]
});
and so on… This is the code for stepper.
<Stepper alternativeLabel nonLinear activeStep={activePage}>
{steps.map((step, index) => {
return (
<Step key={index}>
<StepLabel
onClick={this.handleStep(step)}
disabled={dealsLoading}
>
{step}
</StepLabel>
</Step>
);
})}
</Stepper>
But in all the cases my steps show only 1,2,3,4,. I need to change those numbers according to the steps’ state array.
If I change initial state of steps to [1,2,5,6] (some random) also, step buttons are still 1,2,3,4. Why don’t they change? Or how to change?
If I use StepLabel component it looks like and code for this:
<Stepper alternativeLabel nonLinear activeStep={activePage}>
{steps.map((step, index) => {
return (
<Step key={index}>
<StepLabel
onClick={this.handleStep(step)}
disabled={dealsLoading}
>
{step}
</StepLabel>
</Step>
);
})}
</Stepper>
But I don’t want label. I want those labels should be on step buttons.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
How to change the numbers in steps of material-ui Stepper?
steps : [0 ; this.setState ; this.setState ; Stepper alternativeLabel nonLinear activeStep={activePage}> {steps.map ; Stepper alternativeLabel ...
Read more >How to change the numbers in steps of material ui stepper
I need to change those numbers according to the steps' state array. ... If I change initial state of steps to [1,2,5,6] (some...
Read more >React Stepper component - Material UI - MUI
Steppers convey progress through numbered steps. It provides a wizard-like workflow. Steppers display progress through a sequence of logical and numbered steps.
Read more >How to change numbers in material ui stepper to alphabet like ...
[Solved]-How to change numbers in material ui stepper to alphabet like a,b,c ... from "@material-ui/core/Paper"; import Step from "@material-ui/core/Step"; ...
Read more >How to use Stepper component in Material-UI React
Using activeStep, we can give one number value to Step, which will change the current active step. <Stepper activeStep={1}>.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use the
icon
attribute of StepLabel.@JustinStoddard
For example
icon={3}
oricon="A"
Line 63 in
demo.tsx
:https://codesandbox.io/s/material-demo-6mdwm