Skip to main content
InterviewHubPRO
Section Overview
Q5

Question 5 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

10%
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:

  1. client:load: Hydrates JavaScript immediately upon page load. (Use for critical above-the-fold UI like navigation headers).
  2. client:idle: Hydrates after the main thread is free (when requestIdleCallback fires).
  3. client:visible: Hydrates only when the component enters the user's viewport using IntersectionObserver. (Perfect for footer carousels or comments).
  4. client:media="(max-width: 768px)": Hydrates only if a CSS media query matches (e.g. mobile-only sidebar).
  5. client:only="svelte": Skips server-rendering completely; renders exclusively on the client (for canvas or WebGL components).