Skip to main content

Module islands

Module islands 

Source
Expand description

Interactive islands — lazy-hydrating Web Components. Resumable hydration — interactive islands (Web Components).

Provides an <ssg-island> custom element that lazily loads JavaScript component bundles based on configurable hydration strategies: visible (IntersectionObserver), idle (requestIdleCallback), or interaction (click/focus/hover).

§Architecture

  1. Content authors use {{< island component="counter" hydrate="visible" >}}
  2. The shortcode expands to <ssg-island component="counter" hydrate="visible">
  3. This plugin scans HTML for <ssg-island> elements and:
    • Copies user-provided island bundles from islands/ to _islands/
    • Generates _islands/manifest.json listing all referenced components
    • Injects the ssg-island.js custom element loader into pages

Structs§

IslandPlugin
Plugin that enables interactive islands via Web Components.