--- title: Show description: "`Show` is a component that shows or hides its children based on a condition." links: - source: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/components/show - storybook: https://yamada-ui.github.io/yamada-ui?path=/story/components-show--basic --- # Show `Show` is a component that shows or hides its children based on a condition. ```tsx インビジブルガール 葉隠透 ``` ## Usage ```tsx import { Show } from "@yamada-ui/react" ``` ```tsx import { Show } from "@/components/ui" ``` ```tsx import { Show } from "@workspaces/ui" ``` ```tsx ``` :::tip To hide content visually while keeping it accessible to screen readers, use [VisuallyHidden](https://yamada-ui.com/docs/components/visually-hidden.md). ::: ### Render Conditionally To conditionally render content, set the `when` prop to a boolean value. ```tsx const [isVisible, setIsVisible] = useState(true) return ( インビジブルガール 葉隠透 ) ``` ### With Fallback To render fallback content when the condition is false, use the `fallback` prop. ```tsx const [isVisible, setIsVisible] = useState(false) return ( 衣服}> インビジブルガール 葉隠透 ) ``` ## Props | Prop | Default | Type | Description | | ---------- | ------- | ------------------------ | --------------------------------------------------- | | `children` | - | `ReactNodeOrFunction` | The children to render if `when` is `true` | | `fallback` | - | `ReactNode` | The fallback content to render if `when` is `false` | | `when` | - | `null \| Y` | If `true`, it'll render the `children` prop | ## Similar Components - [ClientOnly](https://yamada-ui.com/docs/components/client-only.md): `ClientOnly` is a component that renders its children only on the client side. - [For](https://yamada-ui.com/docs/components/for.md): `For` is a component used to loop over an array and render a component for each item. - [Format](https://yamada-ui.com/docs/components/format.md): `Format` is used to format dates, numbers, and bytes according to a specific locale. - [Portal](https://yamada-ui.com/docs/components/portal.md): `Portal` is a component that renders elements outside of the current `DOM` hierarchy. - [Slot](https://yamada-ui.com/docs/components/slot.md): `Slot` is a component that merges its props onto its immediate child. ## Used By Components & Hooks - [ClientOnly](https://yamada-ui.com/docs/components/client-only.md): `ClientOnly` is a component that renders its children only on the client side.