UNPKG

@yamada-ui/react

Version:

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

23 lines (21 loc) 917 B
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs'); const require_utils_index = require('../../utils/index.cjs'); let react = require("react"); react = require_rolldown_runtime.__toESM(react); let react_jsx_runtime = require("react/jsx-runtime"); react_jsx_runtime = require_rolldown_runtime.__toESM(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, require_utils_index.utils_exports.runIfFn)(children, when); return (0, react.isValidElement)(result) ? result : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: result }); }; //#endregion exports.Show = Show; //# sourceMappingURL=show.cjs.map