This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
Grid is a primitive layout component that can arrange content in a grid configuration.
import {
__experimentalGrid as Grid,
__experimentalText as Text,
} from '@wordpress/components';
function Example() {
return (
<Grid columns={ 3 }>
<Text>Code</Text>
<Text>is</Text>
<Text>Poetry</Text>
</Grid>
);
}Type: CSS['alignItems']
Adjusts the block alignment of children.
Type: GridAlignment
Adjusts the horizontal and vertical alignment of children.
Type: number,(number,null)[]
Adjusts the number of columns of the Grid.
Type: number
Gap between each child.
Type: boolean
Changes the CSS display from grid to inline-grid.
Type: CSS['justifyContent']
Adjusts the inline alignment of children.
Type: number,(number,null)[]
Adjusts the number of rows of the Grid.
Type: CSS['gridTemplateColumns']
Adjusts the CSS grid template-columns.
Type: CSS['gridTemplateRows']
Adjusts the CSS grid template-rows.