Astro Islands & SSR (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
What are Astro Client Hydration Directives?
senior LevelDirectivesCLISSR & Hydration
In Simple Words:
By default, UI framework components (React, Svelte, Vue) in Astro render as static HTML. To make them interactive on the client, you attach a client:* directive:
client:load: Hydrates JavaScript immediately upon page load. (Use for critical above-the-fold UI like navigation headers).client:idle: Hydrates after the main thread is free (whenrequestIdleCallbackfires).client:visible: Hydrates only when the component enters the user's viewport usingIntersectionObserver. (Perfect for footer carousels or comments).client:media="(max-width: 768px)": Hydrates only if a CSS media query matches (e.g. mobile-only sidebar).client:only="svelte": Skips server-rendering completely; renders exclusively on the client (for canvas or WebGL components).