Navigation Demo
This example shows how html★ enables SPA-style navigation while maintaining browser history, deep linking, and accessibility. Click the nav links to see smooth view transitions between pages.
html★ Features Used
data-target="#main"— Update only the main content areadata-push— Push new entries to browser historydata-transitions— Enable View Transitions API for smooth animations
How It Works
Navigation links cascade attributes from a parent container. When clicked, html★ fetches the new page content and swaps it into the target element, optionally using the View Transitions API for smooth animations.
Key Concepts
- Attribute Cascade — Set
data-targeton a container; all links inherit it - History Management —
data-pushupdates the URL and enables back/forward - View Transitions — Native browser API for smooth page transitions
- Progressive Enhancement — Links work normally without JavaScript