Not able to center content using the Box component in MaterialUI and React

you should use display:flex property for alignItems and justifyContent to work


Use sx={{ display: 'flex' ,justifyContent:'center',alignItems:'center'}} you can not use alignItems and justifyContent as a prop

   <Box sx={{ display: 'flex' ,justifyContent:'center',alignItems:'center'}}>
            <Typography variant="subtitle1" style={{backgroundColor:'red'}}>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit.
            </Typography>
        </Box>

enter image description here