UNPKG

@wordpress/components

Version:
38 lines (37 loc) • 929 B
import { contextConnect } from "../context/index.mjs"; import { View } from "../view/index.mjs"; import { useHStack } from "./hook.mjs"; import { jsx } from "react/jsx-runtime"; // packages/components/src/h-stack/component.tsx function UnconnectedHStack(props, forwardedRef) { const hStackProps = useHStack(props); return /* @__PURE__ */ jsx(View, { ...hStackProps, ref: forwardedRef }); } /** * `HStack` (Horizontal Stack) arranges child elements in a horizontal line. * * `HStack` can render anything inside. * * ```jsx * import { * __experimentalHStack as HStack, * __experimentalText as Text, * } from `@wordpress/components`; * * function Example() { * return ( * <HStack> * <Text>Code</Text> * <Text>is</Text> * <Text>Poetry</Text> * </HStack> * ); * } * ``` */ const HStack = contextConnect(UnconnectedHStack, "HStack"); export { HStack, HStack as default }; //# sourceMappingURL=component.mjs.map