UNPKG

@wordpress/components

Version:
52 lines (48 loc) 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.VStack = void 0; var _context = require("../context"); var _view = require("../view"); var _hook = require("./hook"); var _jsxRuntime = require("react/jsx-runtime"); /** * External dependencies */ /** * Internal dependencies */ function UnconnectedVStack(props, forwardedRef) { const vStackProps = (0, _hook.useVStack)(props); return /*#__PURE__*/(0, _jsxRuntime.jsx)(_view.View, { ...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> * ); * } * ``` */ const VStack = exports.VStack = (0, _context.contextConnect)(UnconnectedVStack, 'VStack'); var _default = exports.default = VStack; //# sourceMappingURL=component.js.map