Dice UI

Client Only

Renders client-only components with hydration and fallback support.

API

Installation

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

Usage

import { ClientOnly } from "@/components/client-only"
 
export default function App() {
  return (
    <ClientOnly fallback={<LoadingSpinner />}>
      <ClientComponent />
    </ClientOnly>
  )
}

API Reference

ClientOnly

A component that only renders its children on the client side.

Prop

Type

On this page