How to set margin in React MUI component

How to set margin in React Material UI components


Material UI /MUI is one word for all React UI needs, as we know. Let’s learn how set margin in a basic box container.

In MUI React component we can use sx property to customize styles. For margin have to use m, mt / ml options.

  <Box sx={{ mt: 1 }}>
.....

This will set the margin top of the Box to 1.

Author: Manoj

Developer and a self-learner, love to work with Reactjs, Angular, Node, Python and C#.Net

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.