# Switch

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

Section: Components / Inputs
Page: https://ui.heyramzi.com/components/switch
Import path: `@heyramzi/ui/shadcn/switch`

## Import

```ts
import { Label } from "@heyramzi/ui/shadcn/label";
import { Switch } from "@heyramzi/ui/shadcn/switch";
```

## Demo

```svelte
<script lang="ts">
	import { Label } from "@heyramzi/ui/shadcn/label";
	import { Switch } from "@heyramzi/ui/shadcn/switch";
</script>

<div class="flex items-center space-x-2">
	<Switch id="airplane-mode" />
	<Label for="airplane-mode">Airplane Mode</Label>
</div>
```

## API

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `size` | `"sm" \| "default"` | `"default"` |  |
| `ref` | `HTMLElement \| null` | `null` | bindable |
| `class` | `string` |  |  |
| `checked` | `boolean` | `false` | bindable |

Every prop of `Switch.Root` from `bits-ui`, except `child, children`.
