UNPKG

@gechiui/components

Version:
48 lines (44 loc) 1.22 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import { createElement } from "@gechiui/element"; /** * Internal dependencies */ import { contextConnect } from '../ui/context'; import { View } from '../view'; import { useVStack } from './hook'; /** * @param {import('../ui/context').GeChiUIComponentProps<import('./types').Props, 'div'>} props * @param {import('react').Ref<any>} forwardedRef */ function VStack(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. * * @example * ```jsx * import { * __experimentalText as Text, * __experimentalVStack as VStack, * } from `@gechiui/components`; * * function Example() { * return ( * <VStack> * <Text>Code</Text> * <Text>is</Text> * <Text>Poetry</Text> * </VStack> * ); * } * ``` */ const ConnectedVStack = contextConnect(VStack, 'VStack'); export default ConnectedVStack; //# sourceMappingURL=component.js.map