Toggle
A two-state button that can be either on or off.
Usage
API Reference
| Input | Type | Default |
|---|---|---|
| variant | ToggleVariants['variant'] | 'default' |
| size | ToggleVariants['size'] | 'md' |
| disabled | boolean | false |
| pressed | boolean | false |
| Output | Type |
|---|---|
| pressedChange | boolean |
CVA variants
| Prop | Options | Default |
|---|---|---|
| variant | default | outline | ghost | solid | default |
| size | sm | md | lg | icon | md |
Component Source
Install via CLI:
npx @voltui/cli add toggleTypeScript
Loading editor…
Copy this code to your project. The component uses ng-primitives/toggle.