Easily create reactive HTML documents thanks to $$
, example:
<script src="https://unpkg.com/dollars.js"></script>
<div>
<button $on-click="count++">Increment</button>
<strong $text="count"></strong>
<button $on-click="count--">Decrement</button>
<script>
$$({ count: 0 });
</script>
</div>
ESM support depends on package.json#exports.
<div id="scope">
<button $on-click="count++">Increment</button>
<strong $text="count"></strong>
<button $on-click="count--">Decrement</button>
<script>
import $$ from "http://esm.sh/dollars.js";
$$(scope, { count: 0 });
</script>
</div>
add a handler to the node
<button $on-click="console.log('click!')">Click!</button>
Print the state in text format inside the node
Static text <span $text="message"></span>
Print the state in html format inside the node
Static html <span $html="message"></span>
define display if the state is false
<button $show="show">Show?</button>
define or remove property according to state
<button $toggle-class-hidden="show">Show?</button>
define the property according to the state
<button $set-class="show?'hidden':null">Show?</button>
iterates over an array and defines access to the loop variable to retrieve cursor properties
<ul>
<template $each="data">
<li>
name: <span $text="loop.name"></span><br />
email: <span $text="loop.email"></span><br />
</li>
</template>
</ul>