@wordpress/components
Version:
UI components for WordPress.
48 lines (43 loc) • 1.05 kB
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 { useVStack } from './hook';
function UnconnectedVStack(props, forwardedRef) {
const vStackProps = useVStack(props);
return createElement(View, _extends({}, vStackProps, {
ref: forwardedRef
}));
}
/**
* `VStack` (or Vertical Stack) is a layout component that arranges child
* elements in a vertical line.
*
* `VStack` can render anything inside.
*
* ```jsx
* import {
* __experimentalText as Text,
* __experimentalVStack as VStack,
* } from `@wordpress/components`;
*
* function Example() {
* return (
* <VStack>
* <Text>Code</Text>
* <Text>is</Text>
* <Text>Poetry</Text>
* </VStack>
* );
* }
* ```
*/
export const VStack = contextConnect(UnconnectedVStack, 'VStack');
export default VStack;
//# sourceMappingURL=component.js.map