Skip to content

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

Props of the native component are also available.

NameTypeDescription
childrennode

The content of the component.

columnsArray<number>
| number
| object

The number of columns.

columnSpacingArray<number
| string>
| number
| object
| string

Defines the horizontal space between the type item components. It overrides the value of the spacing prop.

containerbool

If true, the component will have the flex container behavior. You should be wrapping items with a container.

direction'column-reverse'
| 'column'
| 'row-reverse'
| 'row'
| Array<'column-reverse'
| 'column'
| 'row-reverse'
| 'row'>
| object

Defines the flex-direction style property. It is applied for all screen sizes.

offsetstring
| number
| Array<string
| number>
| object

Defines the offset value for the type item components.

rowSpacingArray<number
| string>
| number
| object
| string

Defines the vertical space between the type item components. It overrides the value of the spacing prop.

sizestring
| bool
| number
| Array<string
| bool
| number>
| object

Defines the size of the the type item components.

spacingArray<number
| string>
| number
| object
| string

Defines the space between the type item components. It can only be used on a type container component.

wrap'nowrap'
| 'wrap-reverse'
| 'wrap'

Defines the flex-wrap style property. It's applied for all screen sizes.

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.