Introduction

Wrium is a minimalist JavaScript library for building reactive user interfaces. Write clean, declarative templates directly in your HTML and power them with a simple, yet powerful, reactivity system - no build step, no compiler, no virtual DOM.

Highlights

  • Reactive primitives: ref (any value), reactive (objects/arrays), computed
  • Effects: watchEffect with automatic dependency tracking
  • Lightweight template compiler for declarative DOM binding and interpolation ({{ }})
  • Template directives: v-if, v-for, v-text, v-show, v-model, v-pre, v-on (shorthand @), v-bind (shorthand :)
  • Event modifiers: .prevent, .stop, .once, .self, .capture, .passive, and key modifiers like .enter
  • Directive registry + plugin architecture: built-in directives register the same way a plugin registers its own (e.g. v-html ships as an opt-in plugin, not core)
  • Components: app.component(name, { template, setup }), used as a custom tag with reactive props
  • App lifecycle: createApp(...).mount(selector) and .unmount()
  • Hook system: extend and customize compilation behavior
  • Async effect queue: batched updates, flushed on a microtask
  • TypeScript declarations generated from source, with proper generics

Browser Support

Requires ES6 Proxy support:

  • Chrome 49+, Firefox 18+, Safari 10+, Edge 12+
  • Internet Explorer is not supported

Bundle Size

  • ~10.9 KB minified (ES build), zero dependencies, no build step required
  • Optional plugins (v-html, password-strength, draggable) are not counted here - they ship separately from core, see Plugins
  • Type declarations are generated at build time and add nothing to the runtime bundle

Next Steps

Wrium v1.0.0 · MIT License