@wordpress/components
Version:
UI components for WordPress.
45 lines (40 loc) • 974 B
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import { createElement } from "@wordpress/element";
/**
* External dependencies
*/
/**
* Internal dependencies
*/
import { contextConnect } from '../ui/context';
import { View } from '../view';
import useGrid from './hook';
function UnconnectedGrid(props, forwardedRef) {
const gridProps = useGrid(props);
return createElement(View, _extends({}, gridProps, {
ref: forwardedRef
}));
}
/**
* `Grid` is a primitive layout component that can arrange content in a grid configuration.
*
* ```jsx
* 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>
* );
* }
* ```
*/
export const Grid = contextConnect(UnconnectedGrid, 'Grid');
export default Grid;
//# sourceMappingURL=component.js.map