UNPKG

@yamada-ui/react

Version:

React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion

20 lines (18 loc) 652 B
import { utils_exports } from "../../utils/index.js"; import { isValidElement } from "react"; import { Fragment as Fragment$1, jsx } from "react/jsx-runtime"; //#region src/components/show/show.tsx /** * `Show` is a component that shows or hides its children based on a condition. * * @see https://yamada-ui.com/docs/components/show */ const Show = ({ children, fallback, when }) => { let result; if (!when) result = fallback; else result = (0, utils_exports.runIfFn)(children, when); return isValidElement(result) ? result : /* @__PURE__ */ jsx(Fragment$1, { children: result }); }; //#endregion export { Show }; //# sourceMappingURL=show.js.map