Created switches

This commit is contained in:
2025-07-19 22:48:01 -04:00
parent 5421c2346a
commit ea7ac27772
18 changed files with 875 additions and 94 deletions

View File

@@ -0,0 +1,35 @@
import type { MattrixwvButtonSwitchProps } from "$/types/Input";
import { Switch } from "@headlessui/react";
export default function ButtonSwitch({
id,
className,
name,
value,
defaultChecked,
checked,
onChange,
disabled,
onNode,
offNode
}: MattrixwvButtonSwitchProps){
return (
<Switch
id={id}
className={className}
name={name}
value={value}
defaultChecked={defaultChecked}
checked={checked}
onChange={onChange}
disabled={disabled}
>
{({ checked }) => (
<>
{checked ? onNode : offNode}
</>
)}
</Switch>
);
}