Toggle
A two-state button that can be either on or off.Examples
Installation
Install the package, then import only the components a route uses. Exports are tree-shakable.
Install
pnpm add fractalsvelteImport
<script lang="ts">
import { Toggle } from 'fractalsvelte';
</script>Usage
Usage
<script lang="ts">
import { Toggle } from 'fractalsvelte';
</script>
<Toggle>Italic</Toggle>Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'default' | 'outline' | 'default' | The visual treatment. |
size | 'sm' | 'md' | 'lg' | 'md' | The control size. |
pressed | boolean | false | The pressed state. Supports bind:. |
disabled | boolean | false | Prevents interaction while preserving semantic state. |
