Docs
Switch

Switch

A control that allows the user to toggle between checked and not checked.

Loading...

Installation

	npx shadcn-svelte@latest add switch

Usage

	<script lang="ts">
  import { Switch } from "$lib/components/ui/switch";
</script>

<Switch />

Examples

Form

When using the switch component in a form, you'll want to use the <Form.Switch /> component, which is a wrapper around your existing <Switch /> component that makes it seamlessly integrate with forms.

Loading...