Material-ui: [Stepper] Remove Paper component

Created on 18 Nov 2019  路  5Comments  路  Source: mui-org/material-ui

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

Summary 馃挕

Would it be a good idea if accepts a component prop? By default, this would be <Paper>

Examples 馃寛

<Stepper component="div">
    <Step>
        <StepLabel>Hello world</StepLabel>
    </Step>
</Stepper>

Motivation 馃敠


I want to render a Stepper that doesn't use Paper - essentially I want it to have very plain styling and not be affected by any global styling that I do to the Paper component.

I believe there isn't a straightforward way to do this already, and was thinking that if we could pass a component to Stepper (which would default to <Paper>) then that would be similar to other components that take a prop that selects the inner component rendered.

breaking change Stepper good to take

Most helpful comment

Current workaround

Giving an override of no border or background for Stepper in the theme definition.

  overrides: {
    MuiStepper: {
      root: {
        background: 'none',
        border: 'none',
      },
    },
  },

It does the trick well enough for now, but I can foresee issues coming later when I add a bit more complicated CSS to the Paper component (which I don't want Stepper receiving)

All 5 comments

Current workaround

Giving an override of no border or background for Stepper in the theme definition.

  overrides: {
    MuiStepper: {
      root: {
        background: 'none',
        border: 'none',
      },
    },
  },

It does the trick well enough for now, but I can foresee issues coming later when I add a bit more complicated CSS to the Paper component (which I don't want Stepper receiving)

@eedrah Thanks for the report. I was keeping track of it at https://trello.com/c/ZDzhlNs9/1527-stepper-remove-paper but it's great to have an issue too.

If Paper is removed, does Stepper need a component prop? It can just be "wrapped in paper" (with ribbon and a bow 馃檪 ):

<Paper>
  <Stepper>
    <Step>
      <StepLabel>Hello world</StepLabel>
    </Step>
  </Stepper>
<Paper>

In the unknown, we can start without a component prop, and wait for a solid use case from a developer?

Yep, it's the approach @eps1lon has advocated for.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

revskill10 picture revskill10  路  3Comments

ericraffin picture ericraffin  路  3Comments

ghost picture ghost  路  3Comments

iamzhouyi picture iamzhouyi  路  3Comments

ghost picture ghost  路  3Comments