Skip to content

dy/sprae

Repository files navigation

spræ

Microhydration for DOM tree with signals-based reactive attributes.

<div id="counter" :scope="{count: 1}">
  <p :text="`Clicked ${count} times`"></p>
  <button :onclick="count++">Click me</button>
</div>

<script src="https://unpkg.com/sprae" start="#counter"></script>

:text :class :style :value :<attr> :if :else :each :scope :fx :ref :on<event>

.debounce .throttle .tick .raf .once
.window .document .root .body .parent .self .outside
.passive .capture .prevent .stop .immediate .<key>

why

Simple reactivity without overhead. Perfect for SPA.
Inspired by alpine, petite-vue and others.

tests npm bundle size npm ॐ