A grid component in react.

Parameters:
NameTypeDescription
propsobject

Component props.

Properties
NameTypeDescription
alignItemsstring

The align-items CSS property, only applies if grid is container.

childrenJSX.Element | null

The React children to contain in the grid component.

columnSpacingnumber

The column spacing between grid items.

containerboolean

Whether the grid component is a container or not.

customAttributesobject

Custom attributes for the component.

customClassesstring | Array | object

Custom classes for the component.

directionstring

The flex-direction CSS property, only applies if grid is container.

elementTypestring

The element type, one of list or div.

itemboolean

Whether the grid component is an item or not.

justifyContentstring

The justify-content CSS property, only applies if grid is container.

rowSpacingnumber

The row spacing between grid items.

spacingstring | number | Array | object

The spacing for the component, as a string, number, array, or object.

typestring

The grid type, one of fixed or fluid, only applies if grid is container.

widthnumber

The width of the grid item in a 12-column grid, from 1 to 12.

wrapboolean

Whether to wrap grid items or not, only applies if grid is container.

refobject | null

Ref to the component.

Since
  • 1.1.18
Returns:

The functional grid component in React.

Type: 
JSX.Element
Example
import Grid from '@gravityforms/components/react/admin/elements/Grid';

return (
    <Grid container columnSpacing={ 4 } rowSpacing={ 4 }>
        <Grid item>
            { 'Grid item 1' }
        </Grid>
        <Grid item>
            { 'Grid item 2' }
        </Grid>
        <Grid item>
            { 'Grid item 3' }
        </Grid>
    </Grid>
);