Clean, SPA-style HTML templates built without React, Vue, or Angular. Client-side routing with hash navigation, view switching, dynamic component loading, animated page transitions, local state management with vanilla JavaScript, and PWA-ready manifest — all the SPA patterns without a framework build step or npm dependency chain.
Get 180+ Templates — $35React and Vue solve real problems at scale — component reuse across hundreds of views, state management across deeply nested trees, and team coordination on large codebases. But for an internal tool with 5 views, a portfolio with client-side filtering, or a dashboard with real-time chart updates, React adds 45KB of runtime, a build pipeline, and a dependency tree that needs weekly security updates. A vanilla JavaScript SPA serves the same user experience without the framework overhead — faster first paint, zero build step, and a codebase any developer can read without framework-specific knowledge.
Hash-based routing: #home, #dashboard, #settings, #profile. JavaScript hashchange event listener: reads window.location.hash, hides all view divs, shows the matching view. No server configuration required — the server always serves index.html, JavaScript handles the rest. History API routing (pushState) for clean URLs without the hash: intercept link clicks, push to history, render the matching view. Fallback to hash routing for static hosting environments that cannot configure 404 → index.html rewrites.
A simple state object: const state = { user: null, theme: 'dark', filters: {} }. A setState function that merges updates and calls render: function setState(updates) { Object.assign(state, updates); render(state); }. Components re-render by reading from state, not storing their own. For async data: fetch returns a promise, setState is called in .then(). For localStorage persistence: JSON.stringify/parse on write/read. This pattern handles 90% of SPA state requirements without Redux, Zustand, or Pinia — add a framework only when this pattern breaks under the complexity of the specific project.
CSS-based view transitions: outgoing view fades out and slides left (transform:translateX(-20px), opacity:0), incoming view slides in from the right (transform:translateX(20px) → translateX(0), opacity:0 → 1). JavaScript: add 'leaving' class to outgoing view, wait for transition duration (250ms), swap views, add 'entering' class. The View Transitions API (Chrome 111+, Safari 18+) provides a native alternative: document.startViewTransition(() => { showNewView(); }) — the browser handles the cross-fade automatically with ::view-transition pseudo-elements for CSS control.
A web app manifest (manifest.json): name, short_name, start_url, display: 'standalone', theme_color, background_color, and icons array. A service worker (sw.js): cache-first strategy for static assets, network-first for API calls. Register in index.html: navigator.serviceWorker.register('/sw.js'). Standalone display mode removes the browser chrome on mobile — the app looks native when added to the home screen. Offline capability: the service worker serves cached pages when the network is unavailable. Cache versioning: update the cache name on each deploy to invalidate stale assets.
| Consideration | React/Vue SPA | Vanilla JS SPA |
|---|---|---|
| Runtime bundle | 45KB+ (React) / 34KB+ (Vue) | 0KB framework — just your code |
| Build step | Required (webpack/vite) | None — open HTML in browser |
| Time to first paint | Slower (JS parse + hydrate) | Faster — no hydration cost |
| Developer knowledge | Framework-specific | Standard HTML/CSS/JS |
| Dependency security | 100–500 npm packages | Zero dependencies |
| Best for | Large teams, complex apps | Solo projects, tools, internal apps |
Commercial licence · No subscription · Instant download · Lifetime updates
Download All 180+ Templates — $35