Toggle
Toggle renders a checkbox to look like a toggle.
Code Example
<Toggle v-model="isChecked" />Components
Toggle is a standalone component.
Toggle
Toggle can be customized with the following props:
| Prop | Type | Description |
|---|---|---|
model-value | string | controls the checked state. Use with v-model |
disabled | boolean | Disables the component both visually and functionally. |
color | string | Sets the color to one of the below prop names. |
| Â Â Â neutral | boolean | Sets the color to neutral. |
| Â Â Â primary | boolean | Sets the color to primary. |
| Â Â Â secondary | boolean | Sets the color to secondary. |
| Â Â Â accent | boolean | Sets the color to accent. |
| Â Â Â info | boolean | Sets the color to info. |
| Â Â Â success | boolean | Sets the color to success. |
| Â Â Â warning | boolean | Sets the color to warning. |
| Â Â Â error | boolean | Sets the color to error. |
size | string | Sets the size. Can be set to one of the below size prop names. |
   lg | boolean | Sets the size to lg |
   md | boolean | Sets the size to md (the default) |
   sm | boolean | Sets the size to sm |
   xs | boolean | Sets the size to xs |
Color
There are two ways of specifying color:
- The
primary,secondary,neutral,accent,info,success,warning, anderrorboolean props. - The
colorprop, which accepts a string with any of the above prop names.
Code Example
<Toggle v-model="isChecked" primary />Size
There are two ways of specifying size:
- The
xs,sm,md, andlgboolean props. - The
sizeprop, which accepts a string with any of the above prop names.
Code Example
<Toggle v-model="isChecked" lg />In Card
Code Example
<Card bordered class="w-64 p-6">
<Label class="cursor-pointer">
<LabelText>Remember Me</LabelText>
<Toggle v-model="isChecked" />
</Label>
</Card>