* feat: add `vee-validate` * chore: update * chore: update `AccountForm` example - add `FormDescription` component - include `src` in tsconfig * refactor: use radix-vue `Slot` component * chore: refresh lockfile * chore: update `ProfileForm.vue` and `AccountForm` fix vee-validate initialValues on components with `componentField` slotProp * chore: update `AppearanceForm.vue` update pnpm and some deps -_- * refactor: update - add new-york style - off eslint import/first rule - use `useId` from radix-vue * fix: class-name -> class * refactor: simplify validation for `Command` component * fix: v-bind="field" -> v-bind="componentField" * fix: useAttrs to prevent class duplication * docs: add `form.md` - change TabPreview.vue to showcase way of using vee-validate * docs: add form example for `checkbox` `input` and `datepicker` * docs: add `combobox`, `datepicker`, `radio-group`, `select`, `switch` and `textarea` form and some other exmaples * chore: typo, update `zod`, `vite`, and `@vitejs/plugin-vue`
46 lines
744 B
Markdown
46 lines
744 B
Markdown
---
|
|
title: Checkbox
|
|
description: A control that allows the user to toggle between checked and not checked.
|
|
source: apps/www/src/lib/registry/default/ui/checkbox
|
|
primitive: https://www.radix-vue.com/components/checkbox.html
|
|
---
|
|
|
|
|
|
<ComponentPreview name="CheckboxDemo" />
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
```bash
|
|
npx shadcn-vue@latest add checkbox
|
|
```
|
|
|
|
## Usage
|
|
|
|
```vue
|
|
<script setup lang="ts">
|
|
import { Checkbox } from '@/components/ui/checkbox'
|
|
</script>
|
|
|
|
<template>
|
|
<Checkbox id="terms" />
|
|
</template>
|
|
```
|
|
|
|
## Examples
|
|
|
|
### With text
|
|
|
|
<ComponentPreview name="CheckboxWithText" />
|
|
|
|
### Disabled
|
|
|
|
<ComponentPreview name="CheckboxDisabled" />
|
|
|
|
### Form
|
|
|
|
<ComponentPreview name="CheckboxFormSingle" />
|
|
|
|
<ComponentPreview name="CheckboxFormMultiple" />
|