Switch component

This commit is contained in:
Mats Bosson 2026-03-29 07:14:52 +07:00
parent 5af7dc6cfa
commit 5bd158782a
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ export function Switch(props: SwitchProps): JSX.Element {
const [isChecked, setChecked] = createControllableSignal<boolean>({
value: () => local.checked,
defaultValue: () => local.defaultChecked ?? false,
onChange: local.onCheckedChange ?? (() => {}),
onChange: local.onCheckedChange,
});
return (

View File

@ -29,7 +29,7 @@ export function Toggle(props: ToggleProps): JSX.Element {
const [isPressed, setPressed] = createControllableSignal<boolean>({
value: () => local.pressed,
defaultValue: () => local.defaultPressed ?? false,
onChange: local.onPressedChange ?? (() => {}),
onChange: local.onPressedChange,
});
return (