Updateing Docs
This commit is contained in:
@@ -1,13 +1,23 @@
|
||||
// components/Swap.js
|
||||
import { $html } from "sigpro";
|
||||
import { joinClass } from "../core/utils.js";
|
||||
import { ui, val } from "../core/utils.js";
|
||||
|
||||
/** SWAP */
|
||||
export const Swap = (props) =>
|
||||
$html("label", { class: joinClass("swap", props.class) }, [
|
||||
/**
|
||||
* Swap component
|
||||
*
|
||||
* daisyUI classes used:
|
||||
* - swap, swap-on, swap-off, swap-active
|
||||
* - swap-rotate, swap-flip, swap-indeterminate
|
||||
*/
|
||||
export const Swap = (props) => {
|
||||
const { class: className, value, on, off, ...rest } = props;
|
||||
|
||||
return $html("label", { ...rest, class: ui('swap', className) }, [
|
||||
$html("input", {
|
||||
type: "checkbox",
|
||||
checked: props.value
|
||||
checked: val(value)
|
||||
}),
|
||||
$html("div", { class: "swap-on" }, props.on),
|
||||
$html("div", { class: "swap-off" }, props.off),
|
||||
$html("div", { class: "swap-on" }, on),
|
||||
$html("div", { class: "swap-off" }, off),
|
||||
]);
|
||||
};
|
||||
Reference in New Issue
Block a user