What is the purpose of boolean values for the breakpoint props (xs, sm, md…) in material-ui

前端 未结 2 1820
误落风尘
误落风尘 2021-01-02 20:04

I am struggling to find documentation on (or results via experimenting with code) what the purpose is of having booleans as values for breakpoint props for the grid componen

2条回答
  •  [愿得一人]
    2021-01-02 20:25

    As per the docs

    • xs, extra-small: 0px or larger
    • sm, small: 600px or larger
    • md, medium: 960px or larger
    • lg, large: 1280px or larger
    • xl, extra-large: 1920px or larger

    Reference https://material-ui.com/layout/breakpoints/

    For example what would be the reason for providing xs={true} or md={false} be? And how might I have learned the reason on my own? (is there some fundamental knowledge I'm lacking?)

    This xs={true} means that the column will take up an equal space that is in a given row. so given

    
      
        xs
      
      
        xs
      
      
        xs
      
    

    This will have 3 equal grids.

    Reference https://material-ui.com/layout/grid/#auto-layout

提交回复
热议问题