Two-way binding · bind=

Ada · agreed · pro · vol 40

Usage

import { signal, html } from "./index.js";

const name = signal("Ada");
const agree = signal(true);
const vol = signal(40);

// bind= is two-way: it reads the signal into the input and writes
// changes back. Works on text, checkbox, select, and range inputs.
html`
  <input class="zap-input" bind=${name} />
  <input type="checkbox" bind=${agree} />
  <input type="range" min="0" max="100" bind=${vol} />
`