Incremental Hydration Triggers
Demo of all 6 supported hydration triggers using the syntax: @defer (hydrate on TRIGGER)
Immediate Trigger
Server RenderedThis component hydrates immediately after the page finishes rendering (requests idle callback not required). Prioritized over idle content.
Idle Trigger
Server RenderedThis component hydrates when the browser is idle (using requestIdleCallback). Good for non-critical content that doesn't need to be interactive immediately.
Timer Trigger (5s)
Server RenderedThis component hydrates automatically after a 5-second delay. Useful for lower priority interactive content.
Interaction Trigger
Server RenderedThis component hydrates when you click the placeholder. The counter works only after hydration.
Hover Trigger
Server RenderedThis component hydrates when you hover over the placeholder. Great for heavy tooltips or optional details.
Detailed Analytics
Custom Condition (When)
Server RenderedThis component hydrates only when the "Hydrate Now" button in the parent component is clicked.
The parent signal became true, triggering hydration.
Never Hydrate
Server Rendered (Static)This component should never hydrate. It remains as static HTML sent from the server.
// This click listener will never work
Scroll down for viewport trigger
⬇
Keep scrolling
Almost there
⬇
Viewport Trigger
Server RenderedThis component hydrates when it enters the viewport. It might have been below the fold initially.
Heavy Data List (Simulated)
- Item 1 - Loaded lazily
- Item 2 - Loaded lazily
- Item 3 - Loaded lazily
- Item 4 - Loaded lazily
- Item 5 - Loaded lazily