Switch · toggle

State: on

Usage

JavaScript
import { signal } from "./index.js";import { Switch } from "./components/switch.js"; const notifications = signal(true); // value is a boolean signal it reads + writes; onChange fires after toggle.Switch({ value: notifications,         onChange: (v) => toast(v ? "On" : "Off") })