Toggle
A toggle switch component for boolean input with multiple sizes and smooth animations.
<!-- +page.svelte -->
| Prop | Type | Default | Description |
|---|---|---|---|
| checked | boolean | false | Controls the toggle state (bindable) |
| disabled | boolean | false | Disables the toggle interaction |
| size | 'sm' | 'md' | 'lg' | 'md' | Controls the size of the toggle |
| className | string | '' | Additional CSS classes to apply |
Note: The Toggle component also accepts all standard HTML button attributes
via $$restProps.
Size Examples
Small:
Medium:
Large:
States
Unchecked:
Checked:
Disabled: