Material-ui: [Button] Add fullWidth property

Created on 15 Dec 2017  路  9Comments  路  Source: mui-org/material-ui

In the olde version Button had a fullWidth. The textFields have also a fullWidth.

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

Expected Behavior

The Button needs to have a fullWidth option.
Example: <Button fullWidth>Logion</Button>

Current Behavior

does not apply

Steps to Reproduce (for bugs)

does not apply

Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI | 1.0.0-beta.17 |
| React | 15.5.4 |
| browser | chrome |
| etc | |

Button enhancement

Most helpful comment

I don't agree we should be adding it. It's on the slippery slope of utility props for things that can already easily be done with CSS.

All 9 comments

Can i take care of this one?

I don't agree we should be adding it. It's on the slippery slope of utility props for things that can already easily be done with CSS.

@mbrookes The main arguments are the following:

  • For symmetry with the Input and TextField component
  • Bootstrap is exposing such feature and I have found myself repeating the extra CSS a lot. So I have two choices. I can add it on the wrapping components we use at the office or add it to the core.

But maybe you are right. Let's wait people up votes.

Full width button is key for us for mobile.

Not sure if it's needed in core, but we currently use a wrapper to add the fullWidth option

@sakulstra Same story on my side. But it's quite a common use case, already 10 up votes. Bootstrap has the notion of "block" (display block and width 100%). Do you think it's more appropriate?

@oliviertassinari Given that we have a similar prop on other components, and a decent number of upvotes, it seems like this should go ahead.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FranBran picture FranBran  路  3Comments

reflog picture reflog  路  3Comments

activatedgeek picture activatedgeek  路  3Comments

newoga picture newoga  路  3Comments

anthony-dandrea picture anthony-dandrea  路  3Comments