I'm working on a component that contains three different Typography components. I need to align "summary" to the left, while 'miles' and 'duration' should be aligned to the right.
https://i.stack.imgur.com/7e9sY.png
Here's the code snippet:
<Stack direction="row" spacing={1} divider={<Divider orientation="vertical" flexItem />} justifyContent='flex-end'>
<Box align='left'>
<Typography>Summary</Typography>
</Box>
<Box>
<Typography sx={{ verticalAlign: 'middle', display: 'inline-flex' }}><DirectionsCarIcon /> {Math.round(totalDistance * 0.000621371192 * 10) / 10} Miles</Typography>
</Box>
<Box>
<Typography sx={{ verticalAlign: 'middle', display: 'inline-flex' }}><AccessTimeIcon /> {totalDuration}</Typography>
</Box>
</Stack>
I've experimented with the justifyContent attribute but haven't had any luck. As someone new to CSS and styling, I'm unsure of the best way to approach this situation.