Closed Industrial closed 1 year ago
Hi.
I'm copying source code from a MUI project and I have:
<Grid container rowSpacing={2} columnSpacing={2} sx={{ marginTop: 0, width: '100%', marginLeft: 0, }} > <Grid xs={12} sx={{ marginBottom: 1, }} > <Typography variant="h3">{title}</Typography> </Grid> <Grid xs={12} sm={6} lg={3}> <CounterCard count={listsCount} label="Lists" href="/lists" /> </Grid> <Grid xs={12} sm={6} lg={3}> <CounterCard count={projectsCount} label="Projects" href="/projects" /> </Grid> <Grid xs={12} sm={6} lg={3}> <CounterCard count={tagsCount} label="Tags" href="/tags" /> </Grid> <Grid xs={12} sm={6} lg={3}> <CounterCard count={itemsCount} label="Items" href="/items" /> </Grid> </Grid>
marginTop
width
marginLeft
-16px
rowSpacing
columnSpacing
Are you using @mui/material/Unstable_Grid2?
@mui/material/Unstable_Grid2
You aren't setting the item property in the Grid components.
item
Grid
https://stackblitz.com/edit/react-kqfhe6?file=demo.tsx
Right, it works correctly now. Thanks!
Hi.
I'm copying source code from a MUI project and I have:
marginTop
,width
andmarginLeft
then it will be at-16px
which will throw off the design/layout. This does not happen with MUI.rowSpacing
andcolumnSpacing
do not add CSS properties to the output HTML/CSS, so all the columns/cards stick together.