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.
If you do not want to use the Grid component, you have to rely on CSS.
But if you use Material-UI you should use JSS (CSS-IN-JS) and not plain CSS.
In CSS you may use any of these solutions for example. "text-align" being the simplest one.
text-align: right
float: right
display: flex
align-content: flex-end
Try this
Material UI's Grid Component has helper props to achieve this.
You can find the docs here.