Checkbox
Checkbox renders a beautiful checkbox input.
Code Example
<Checkbox v-model="isChecked" />Components
Checkbox is a standalone component.
Checkbox
Checkbox can be customized using 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
<Checkbox 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
<Checkbox v-model="isChecked" lg />With Label
Wrapping Checkbox and LabelText inside of a Label produces a nice UX. The user can click anywhere inside the Label to toggle the checkbox state.
Code Example
<Label class="cursor-pointer">
<LabelText>Remember Me</LabelText>
<Checkbox v-model="isChecked" />
</Label>