How to align horizontal icon and text in Material-UI

前端 未结 8 2012
后悔当初
后悔当初 2021-01-31 07:35

I am a newbie in material-ui, now my icon and text are not aligned :

\"not

My desired results:

8条回答
  •  猫巷女王i
    2021-01-31 08:33

    Having ListItemIcon and ListItemText wrapped inside a ListItem will keep it in one line and prevent breaking:

    import ListItem from '@material-ui/core/ListItem';
    import ListItemIcon from '@material-ui/core/ListItemIcon';
    import ListItemText from '@material-ui/core/ListItemText';
        
    
      
      Updated 1 hour ago
    
    

    Demo image:

    Demo image

提交回复
热议问题