From bf3ee406410288211bff325674efff06420cfbc8 Mon Sep 17 00:00:00 2001 From: Natxo <1172351+natxocc@users.noreply.github.com> Date: Tue, 31 Mar 2026 12:17:05 +0200 Subject: [PATCH] Add Swap component for toggle functionality --- src/components/Swap.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/components/Swap.js diff --git a/src/components/Swap.js b/src/components/Swap.js new file mode 100644 index 0000000..e8cfe04 --- /dev/null +++ b/src/components/Swap.js @@ -0,0 +1,13 @@ +import { $html } from "sigpro"; +import { joinClass } from "../core/utils.js"; + +/** SWAP */ +export const Swap = (props) => + $html("label", { class: joinClass("swap", props.class) }, [ + $html("input", { + type: "checkbox", + checked: props.value + }), + $html("div", { class: "swap-on" }, props.on), + $html("div", { class: "swap-off" }, props.off), + ]);