Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Shadcn Client Only for React and Tailwind

Render content only on the client side.

Installation

bunx --bun shadcn@latest add https://kit.dev/r/client-only.json

Usage

import { ClientOnly } from "@/components/ui/client-only";
<ClientOnly>
  <div className="rounded-xl border bg-muted px-4 py-3 text-foreground text-sm">
    This content is only rendered on the client side.
  </div>
</ClientOnly>

Demos

Fallback

API Reference

ClientOnly

PropType
AttributeType