Grid2 API
API reference docs for the React Grid2 component. Learn about the props, CSS, and other APIs of this exported module.
Demos
Import
import Grid2 from '@mui/material/Grid2';
// or
import { Grid2 } from '@mui/material';Learn about the difference by reading this guide on minimizing bundle size.
Props of the native component are also available.
| Name | Type | Description | 
|---|---|---|
| children | node | The content of the component. | 
| columns | Array<number> | number | object | The number of columns. | 
| columnSpacing | Array<number | string> | number | object | string | Defines the horizontal space between the type  | 
| container | bool | If  | 
| direction | 'column-reverse' | 'column' | 'row-reverse' | 'row' | Array<'column-reverse' | 'column' | 'row-reverse' | 'row'> | object | Defines the  | 
| offset | string | number | Array<string | number> | object | Defines the offset value for the type  | 
| rowSpacing | Array<number | string> | number | object | string | Defines the vertical space between the type  | 
| size | string | bool | number | Array<string | bool | number> | object | Defines the size of the the type  | 
| spacing | Array<number | string> | number | object | string | Defines the space between the type  | 
| wrap | 'nowrap' | 'wrap-reverse' | 'wrap' | Defines the  | 
ref is forwarded to the root element.Theme default props
You can use MuiGrid2 to change the default props of this component with the theme.