Introduction
What is html-star and why use it
html★ enhances well-written HTML with declarative AJAX capabilities, rewarding semantic markup by inferring behavior from standard attributes.
What is html★?
html★ is a lightweight JavaScript library that brings AJAX capabilities to your HTML using data-* attributes. Instead of writing JavaScript to handle clicks, fetch data, and update the DOM, you simply add attributes to your existing HTML elements.
Philosophy: html★ follows the principle of progressive enhancement. Your pages work perfectly without JavaScript — html★ just makes them better.
Core Principles
- Inference over annotation — URLs from
href/action, methods frommethod/formmethod - Cascade over repetition — Parent attributes flow to children; override when needed
- Platform over abstraction — View Transitions, Navigation API, Dialog, Popover
- Valid HTML only — All configuration via
data-*attributes or<meta>tags - Progressive enhancement — Links work without JS; JS makes them better
Why html★?
Modern web development often requires complex JavaScript frameworks to achieve simple interactions. html★ takes a different approach:
- No build step — Just add a script tag and start using it
- Tiny footprint — Under 8KB gzipped, no dependencies
- Standards-based — Uses native browser APIs like View Transitions
- Accessible by default — Works with screen readers and keyboard navigation
What html★ is NOT
html★ is intentionally minimal. It does not include:
- DOM diffing/morphing (use idiomorph if needed)
- Client-side routing (uses real URLs)
- State management (use native APIs or other libraries)
- WebSocket support (SSE only)
These limitations are features, not bugs. They keep the library small and focused.
Next Steps
Ready to get started? Check out the Installation guide or jump straight to the Quick Start.