Docs
Switch
Switch
A control that allows the user to toggle between checked and not checked.
Loading...
<script lang="ts">
import { Label } from "@/components/ui/label";
import { Switch } from "@/components/ui/switch";
</script>
<div class="flex items-center space-x-2">
<Switch id="airplane-mode" />
<Label for="airplane-mode">Airplane Mode</Label>
</div>
<script lang="ts">
import { Label } from "@/components/ui/label";
import { Switch } from "@/components/ui/switch";
</script>
<div class="flex items-center space-x-2">
<Switch id="airplane-mode" />
<Label for="airplane-mode">Airplane Mode</Label>
</div>
Installation
npx shadcn-svelte add switch
Usage
<script lang="ts">
import { Switch } from "$components/ui/switch";
</script>
<Switch />
On This Page