Islands (optional)

Resumability is the default for every #[component]. Islands are an optional extra boundary for heavy lazy JS, load = \"visible\", or dev HMR.

Default: resumable components

#[component]
fn Counter() -> View {
    let n = use_signal(0);
    view! {
        <button onClick={move |_| n.update(|v| *v += 1)}>"+"</button>
    }
}
// Handlers lazy-load from /_resuma/handler/Counter.js — no #[island] needed.

#[island] — when you need more

#[island(load = "visible")]
fn LiveChart() -> View {
    let points = use_signal(vec![1, 4, 2, 8]);
    view! { /* heavy widget */ }
}

When to use islands

  • Very heavy client-only widgets (charts, editors)
  • Defer JS until visible (load = \"visible\")
  • Dev HMR refresh via /_resuma/island/:instance

For counters, forms, filters, and most UI — #[component] + computed! / effect! is enough.