# Toggle

A two-state button that can be either on or off.

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

## Import

```ts
import { Toggle } from "@heyramzi/ui/shadcn/toggle";
```

## Demo

```svelte
<script lang="ts">
	import { BookmarkSimple } from "phosphor-svelte";
	import { Toggle } from "@heyramzi/ui/shadcn/toggle";
</script>

<Toggle
	aria-label="Toggle bookmark"
	size="sm"
	variant="outline"
	class="data-[state=on]:bg-transparent data-[state=on]:*:[svg]:fill-blue-500 data-[state=on]:*:[svg]:stroke-blue-500"
>
	<BookmarkSimple aria-hidden="true" />
	Bookmark
</Toggle>
```

## API

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

Every prop of `Toggle.Root` from `bits-ui`.
