Toggle

A toggle switch component for boolean input with multiple sizes and smooth animations.

<!-- +page.svelte -->
PropTypeDefaultDescription
checkedbooleanfalseControls the toggle state (bindable)
disabledbooleanfalseDisables the toggle interaction
size'sm' | 'md' | 'lg''md'Controls the size of the toggle
classNamestring''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: