Material-ui: IconButtons won't float right inside CardActions

Created on 12 Aug 2015  路  5Comments  路  Source: mui-org/material-ui

I don't understand how to make my IconButtons float right. I just want to put a delete-icon to the bottom right of my card in the CardActions section. How would I do this?

style={{float:'right'}} doesn't work on my Icon, IconButton components.

bug 馃悰

Most helpful comment

This seems a very basic feature, I think the having a workaround is not the best approach.

All 5 comments

This works for me...
<CardActions style={{ width: '100%', textAlign: 'right' }}>

@antilect : DId you try the above solution. I am closing this issue for now, but if you are now able to solve the issue using the above suggestion do let me know. I will reopen and investigate the issue for you.

This seems a very basic feature, I think the having a workaround is not the best approach.

I style my actions using flex display.

const styles = theme => ({
    actions: {
        display: 'flex',
    },
    expand: {
        marginLeft: 'auto',
    },
});

and then

<CardActions className={classes.actions} disableActionSpacing>
  <IconButton className={classes.expand}>
    <SaveAltIcon />
  </IconButton>
  <IconButton>
    <EditIcon />
  </IconButton>
</CardActions>

This works with one or more icons

This works for me...
<CardActions style={{ width: '100%', textAlign: 'right' }}>

This worked for me:
style={{ width: '100%', justifyContent: 'flex-end' }}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pola88 picture pola88  路  3Comments

ryanflorence picture ryanflorence  路  3Comments

mb-copart picture mb-copart  路  3Comments

chris-hinds picture chris-hinds  路  3Comments

FranBran picture FranBran  路  3Comments