Examples
Basic
Prop | Default | Type | Description |
---|---|---|---|
defaultValue | - | boolean | The initial pressed state of the toggle when it is first rendered. Use this when you don't need to manage its open state manually. |
disabled | false | boolean | When set to true , disables user interaction with the toggle. |
pressed | - | boolean | The controlled pressed state of the toggle, which can be bound using v-model . |
Read more in Button component
Read more in Radix Toggle Root API.
Variant and Color
Prop | Default | Type | Description |
---|---|---|---|
toggle-on | soft-accent | {variant}-{color} | Change the color of the toggle when it is on. |
toggle-off | ghost-gray | {variant}-{color} | Change the color of the toggle when it is off. |
Read more in Button variant and color section
Slots
Read more in Button component slots
Presets
shortcuts/toggle.ts
Props
types/toggle.ts