What is the difference between Box and Grid in materiel-ui

What is the difference between Box and Grid in material-UI

When to use each one

I’m confused by that

Add Comment
1 Answer(s)
The grid creates visual consistency between layouts while allowing flexibility across a wide variety of designs. Material Design’s responsive UI is based on a 12-column grid layout How it works The grid system is implemented with the Grid component:  It uses CSS’s Flexible Box module for high flexibility. There are two types of layout: containers and items. Item widths are set in percentages, so they’re always fluid and sized relative to their parent element. Items have padding to create the spacing between individual items. There are five grid breakpoints: xs, sm, md, lg, and xl.  A Box is just that, a box. It's an element wrapped around its content which by itself contains no styling rules nor has any default effects on the visual output. But it's a place to put styling rules as needed. It doesn't offer any real functionality, just a placeholder for controlling the styles in the hierarchical markup structure.  I often think of it as semantically similar to the JSX empty element:<br> **<>   Some elements here </>**  But just with some Material UI capabilities: <br>    <Box component="span" m={1}>          <Button />    </Box> 
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.