hyperfixi

Tree-shakeable hyperscript runtime.
Human-readable UI behaviors from 5KB.

hyperfixi is a modular hyperscript runtime with 43 commands, tree-shakeable Vite builds, and ~85% compatibility with _hyperscript. Ship only the commands you use.

Tree-Shakeable

Ship only the commands you use. The Vite plugin generates optimal bundles automatically — from 5KB.

Hypermedia Built In

Optional htmx-like capabilities included — or pair with your existing htmx setup.

Drop-In Compatible

~85% compatible with _hyperscript. Migrate existing projects with minimal changes.

43 commands 5KB lite bundle 8100+ tests ~85% _hyperscript compat

Try It - Live Interactive Demos

Toggle Class

on click toggle .active on me

Counter

on click
  set my.count to (my.count or 0) + 1
  put 'Clicks: ' + my.count into me

Color Cycle

on pointerdown
  repeat until event pointerup
    set rand to Math.random() * 360
    transition *background-color
      to `hsl($rand 100% 90%)`
      over 250ms
  end

Choose Your Bundle Size

Bundle Size Commands Best For
hyperfixi-lite.js 5 KB 8 Minimal interactions (toggle, add, remove)
hyperfixi-lite-plus.js 8 KB 14 More commands + aliases
hyperfixi-hybrid-complete.js 28 KB 21 + blocks Most projects (if/else, repeat, fetch)
hyperfixi-hybrid-hx.js 39 KB 21 + htmx/fixi htmx & fixi attribute compatibility
hyperfixi-browser.js 280 KB 43 Full features + parser

All sizes are uncompressed. With Vite tree-shaking, you ship only the commands you actually use.

Quick Start

CDN (Simplest)

<script src="https://unpkg.com/@hyperfixi/core/dist/hyperfixi-browser.js"></script>

<button _="on click toggle .active on me">
  Click me
</button>

npm + Vite (Recommended)

npm install @hyperfixi/core @hyperfixi/vite-plugin
// vite.config.js
import { hyperfixi } from '@hyperfixi/vite-plugin';

export default {
  plugins: [hyperfixi()]
};

The Vite plugin automatically scans your code and generates a minimal bundle with only the commands you use.

Events First

Send, receive, filter, queue, and debounce events with ease. Chain events together for complex interactions.

Async Built-In

No promises, async/await, or callback hell. hyperfixi transparently handles asynchronous behavior.

_hyperscript Compatible

~85% compatible with existing _hyperscript code. Migrate projects with minimal changes.

Tree-Shakeable

Only include the commands you use. The Vite plugin generates optimal bundles automatically.

MCP Integration

22 tools for AI assistants: validation, pattern search, and code generation via @hyperfixi/mcp-server.

Multilingual Ready

Need multilingual support? Add @lokascript/i18n for 24-language support. See LokaScript docs.

Ready to Get Started?