How to align a component to the center/right

I want to align my button to the right of the parent.

I was wondering if there is a proper way to do it in material-ui. I could use a <Grid container justify="flex-end"> but then I would have to use another <Grid item />. Seems too much of work.

Or maybe I am just better off using plain old CSS, messing around with float: right and dealing with the apparent zero height of the element.

Answer

Try this

<Grid container justify="flex-end">
     <Button>Example</Button>
</Grid>

Leave a Reply

Your email address will not be published. Required fields are marked *