Switch

Yes/no input where the value is associated with “on”/“off”.

  
false
  
PropTypeDescription
labelstringInput label
namestringInput name attribute
bind:checkedbooleanTwo-way binding for state
<script lang="ts">
import Switch from '../components/switch.svelte';

let checked = false;
</script>

<Switch name="bool" label="Enable" bind:checked />

<pre>
  <code>
{checked}
  </code>
</pre>