html★ naturally supports islands architecture by enhancing only the elements you choose, leaving static content untouched.

What is Islands Architecture?

Islands architecture is a pattern where most of your page is static HTML, with small "islands" of interactivity scattered throughout. Instead of hydrating the entire page with JavaScript, only specific components become interactive.

This approach was popularized by frameworks like Astro, but html★ achieves the same result with a simpler mental model: add data-* attributes only where you need interactivity.

The Key Difference: Unlike component-based islands frameworks, html★ doesn't require you to think about "components" at all. You just write HTML and add attributes where you want dynamic behavior.

Natural Island Boundaries

With html★, islands are defined by where you place your data-* attributes. Static content stays static:

In this example, the header, article, and footer are completely static. Only the comments section has html★ attributes, making it the only "island" of interactivity.

Multiple Islands Example

A typical e-commerce product page might have several independent islands:

Benefits

Using html★ for islands architecture provides several key advantages:

Smaller JavaScript Footprint

html★ is under 8KB gzipped. Compare this to component-based frameworks that often require 50KB+ just for the runtime, plus the component code itself.

Faster Initial Render

Static content renders immediately. There's no JavaScript execution blocking the first paint. Interactive islands enhance progressively after the page loads.

SEO-Friendly

Your content is real HTML that search engines can index. No client-side rendering means crawlers see exactly what users see.

Progressive Enhancement

Islands work without JavaScript too. Forms submit normally, links navigate normally. html★ just makes them better when JS is available.

No Build Step Required

Unlike component-based islands frameworks, html★ doesn't require compilation. Just add the script tag and start adding attributes.

Islands vs Full-Page Enhancement

You can choose your level of enhancement:

ApproachUse CaseExample
Minimal islandsContent-heavy sites (blogs, docs)Only forms and search are enhanced
Section-based islandsMixed content (e-commerce, dashboards)Specific sections get interactivity
Full SPA-styleHighly interactive appsGlobal data-target on body

No Configuration Needed: html★ doesn't have an "islands mode" to enable. The architecture emerges naturally from how you use attributes. Place them sparingly for islands, or broadly for SPA-style behavior.

Best Practices

  1. Start static — Write your page as plain HTML first
  2. Identify interactions — Mark which parts need to be dynamic
  3. Add attributes selectively — Only enhance what needs it
  4. Keep islands independent — Each island should work on its own
  5. Use cascade wisely — Set attributes on containers, not every element

Next Steps