Islands (optional)

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

LIVE

#[island]

Island counter: 0

Default: resumable components

#[component]
fn Counter() {
    let n = signal(0);
    view! {
        <button onClick={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() {
    let points = 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.