Back to Shark UI

Client Only

docs/utilities/client-only

latest5.5 KB
Original Source

Sections

Components

Utilities

Forms

Hooks

Client Only

Copy Markdown

Render content only on the client side.

Docs

PreviewCode

Installation#

CLIManual

pnpmbunnpmyarn

pnpm dlx shadcn@latest add @shark/client-only

Usage#

import { ClientOnly } from "@/registry/react/components/client-only";
<ClientOnly>
  <div>This content only renders on the client.</div>
</ClientOnly>

Examples#

With fallback#

Pass fallback to show content while the client-only content is loading:

PreviewCode

Loading…

API Reference#

ClientOnly#

Shows children only on the client. Useful for hydration-safe client components.

PropTypeDefault
fallbackReactNode-

For a complete list of props, see the Ark UI documentation.

[

Previous page

Tree View ](/docs/components/tree-view)[

Next page

Download Trigger ](/docs/utilities/download-trigger)

On This Page

InstallationUsageExamplesWith fallbackAPI ReferenceClientOnly