# Client Only URL: https://ark-ui.com/docs/utilities/client-only Source: https://raw.githubusercontent.com/chakra-ui/ark/refs/heads/main/website/src/content/pages/utilities/client-only.mdx Render content only on the client side. --- ## Motivation The `ClientOnly` component renders its children only on the client side. This is useful for components that need to access the DOM or browser APIs that are not available on the server side. ## Examples ### Basic **Example: basic** #### React ```tsx import { ClientOnly } from '@ark-ui/react/client-only' export const Basic = () => (
This content is only rendered on the client side.
) ``` #### Solid ```tsx import { ClientOnly } from '@ark-ui/solid/client-only' export const Basic = () => (
This content is only rendered on the client side.
) ``` #### Vue ```vue ``` #### Svelte ```svelte
This content is only rendered on the client side.
``` ### With Fallback **Example: with-fallback** #### React ```tsx import { ClientOnly } from '@ark-ui/react/client-only' export const WithFallback = () => ( Loading...}>
This content is only rendered on the client side.
) ``` #### Solid ```tsx import { ClientOnly } from '@ark-ui/solid/client-only' export const WithFallback = () => ( Loading...}>
This content is only rendered on the client side.
) ``` #### Vue ```vue ``` #### Svelte ```svelte {#snippet fallback()}
Loading...
{/snippet}
This content is only rendered on the client side.
``` ## API Reference **Component API Reference** #### React **ClientOnly Props:** | Prop | Type | Required | Description | |------|------|----------|-------------| | `fallback` | `string | number | bigint | boolean | ReactElement> | Iterable | ReactPortal | Promise<...>` | No | | #### Solid **ClientOnly Props:** | Prop | Type | Required | Description | |------|------|----------|-------------| | `fallback` | `number | boolean | Node | (string & {}) | ArrayElement` | No | | #### Svelte **ClientOnly Props:** | Prop | Type | Required | Description | |------|------|----------|-------------| | `fallback` | `Snippet<[]>` | No | |