I ran into this issue where I have several Material UI Cards in a MUI Grid component. I would like the left side of this grid perfectly vertically aligned with the title above.
I tried putting a spacing={2} on the Grid container, but this causes that the padding of the Grid item also is on the left side, which makes it not aligned with the title above anymore. Is there a way to simply have this padding on the inside between the different Grid items?
<Box my={2}>
<Typography variant='h6'>
Hoeveel spaart u maandelijks tot uw pensioen?
</Typography>
</Box>
<Grid className={classes.scenarioBlock} container spacing={2}>
<Grid item xs={12} sm={6}>
<ScenarioOption selected {...monthlySavingGoal}>
<CustomSlider
onChange={
value =>
setAmounts(state => ({ ...state, monthlySavings: value }))
// should we check the scenario when they move the slider?
// if (!selected[name]) setSelected((state) => ({ ...state, [name]: true }));
}
color='primary'
value={amounts.monthlySavings}
min={monthlySavingGoal.sliderValues.min}
max={monthlySavingGoal.sliderValues.max}
step={monthlySavingGoal.sliderValues.step}
/>
</ScenarioOption>
</Grid></Grid>
