Lambda UI
v1.3.4
Stable

ClientOnly

A utility component that renders its children only on the client side, preventing SSR hydration mismatches.

Usage

The ClientOnly component wraps content that should only render on the client side, preventing server-side rendering hydration mismatches.

With Fallback

You can provide a fallback prop to display content during server-side rendering or before client hydration completes.

Loading client content...

Use Cases

Common scenarios where ClientOnly is useful:

  • Accessing browser-only APIs (localStorage, window, document)
  • Rendering components that depend on client-side state
  • Preventing hydration mismatches with dynamic content
  • Lazy-loading heavy components only on the client

Detecting browser...

ClientOnly Props

Props

Prop
Default
Type
children
undefined
React.ReactNode
fallback
null
React.ReactNode
The modern React component library.
© 2026 Lambda UI. Made with in Mexico by AletzMan.