Switch

The Switch component provides a toggle control for binary states like on/off or enabled/disabled.

Import

<script>
  import { Switch } from 'svelte-fluentui';
</script>
svelte

Basic Usage

<Switch>Enable notifications</Switch>
svelte

Checked by Default

<Switch checked>Auto-save enabled</Switch>
svelte

Disabled State

<Switch disabled>Feature unavailable</Switch>
svelte

Properties

PropertyTypeDefaultDescription
checkedbooleanfalseWhether the switch is on
disabledbooleanfalseWhether the switch is disabled
valuestringundefinedValue when used in a form

Events

EventDescription
on:changeFired when the switch state changes