Material-ui: [Avatar] Add shape="square" support

Created on 28 Sep 2017  路  7Comments  路  Source: mui-org/material-ui

i want to use Avatar component with square image but default behaviour of avatar in rounded i tried to find a prop for square image but didn't find is there any way to make it square???

Avatar enhancement good first issue

Most helpful comment

You can use the style prop and set the borderRadius to 0 instead of 50%.

<Avatar src="images/uxceo-128.jpg" style={{ borderRadius: 0 }} />

All 7 comments

You can use the style prop and set the borderRadius to 0 instead of 50%.

<Avatar src="images/uxceo-128.jpg" style={{ borderRadius: 0 }} />

simongavelin thanks it works

@simongavelin Thanks for answering the question.
@waheed25 Next time, please use Stackoverflow with material-ui tag. It's better suited for it.

Thanks, best way for me.

I think that it would be great to add native support for it. What about this API?

variant?: 'round' | 'square';

Looks good. I'd like to work on this as my first PR.

I've used material-ui in 4 projects already, and wish to contribute to the project.

Added native support using @oliviertassinari's suggested API, see PR #18116.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ericraffin picture ericraffin  路  3Comments

rbozan picture rbozan  路  3Comments

TimoRuetten picture TimoRuetten  路  3Comments

reflog picture reflog  路  3Comments

ghost picture ghost  路  3Comments