Toggle

A binary switch for preferences and persistent on-off settings.

The Toggle Component

Basic Usage

Code Snippet

<script lang="ts">		import { Toggle } from '$lib/components'; 		let checked = $state(false);	</script> 	<Toggle bind:checked={checked} ariaLabel="Enable dark mode" />

Examples

States

Use size and disabled states to adapt the switch to the surrounding surface.