client:only

The client:only directive skips server rendering and renders the component entirely on the client.

Since Astro 1.0 Spec ↗

Syntax

<Map client:only="react" />

Examples

---
import LiveMap from '../components/LiveMap.jsx';
---
<LiveMap client:only="react" />
Output
The map is not server-rendered; only a placeholder ships until the client renders it with React.

Notes

Required for components that depend on browser-only APIs (window, localStorage, canvas libs) and cannot SSR. You must specify the framework name as the value. There is no server HTML, so provide fallback content via a slot to avoid layout shift.

See also