Build your first html★ enhanced page in under 5 minutes.

Step 1: Add the Script

Include html★ in your HTML file:

Step 2: Create Navigation

Add a navigation with data-target to specify where content loads:

What's happening?

  • data-target="#main" — Load content into the #main element
  • data-push — Update the browser URL (enables back button)
  • All child links inherit these attributes automatically!

Step 3: Create Page Fragments

Create simple HTML files for each page. No <html> or <head> needed — just the content:

pages/home.html:

pages/about.html:

Step 4: Add View Transitions (Optional)

Enable smooth animations by adding data-transitions to your html element:

Add some CSS for the transition:

Complete Example

Try It Out

That's it! You now have SPA-style navigation with:

  • ✓ AJAX page loading
  • ✓ Browser history support
  • ✓ Smooth View Transitions
  • ✓ Graceful fallback (works without JS)

Next Steps