UNPKG

@wordpress/components

Version:
39 lines (38 loc) • 957 B
import { contextConnect } from "../context/index.mjs"; import { View } from "../view/index.mjs"; import { useVStack } from "./hook.mjs"; import { jsx } from "react/jsx-runtime"; // packages/components/src/v-stack/component.tsx function UnconnectedVStack(props, forwardedRef) { const vStackProps = useVStack(props); return /* @__PURE__ */ jsx(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 = contextConnect(UnconnectedVStack, "VStack"); export { VStack, VStack as default }; //# sourceMappingURL=component.mjs.map