Trên trang này

Trang này chưa có bản tiếng Việt, nội dung bên dưới là bản tiếng Anh. Xem trang tiếng Anh

Checkbox

Install, props and the parts Checkbox is built from.

Install

Run this in the app, after shadcn-vue init and the Beehexa theme (Button › Code):

npx shadcn-vue@latest add https://beehexa.design/r/checkbox.json

Use

<script setup lang="ts">
import { ref } from 'vue'
import { Checkbox } from '@/components/ui/checkbox'
import { Label } from '@/components/ui/label'
const syncOrders = ref(true)
</script>

<template>
  <div>
    <Checkbox id="sync-orders" v-model="syncOrders" />
    <Label for="sync-orders">Sync orders</Label>
  </div>
</template>

Props

Part Prop Values Notes
Checkbox v-model true, false, "indeterminate" Indeterminate shows a dash
Checkbox disabled boolean Disabled colours, no opacity

Built on

reka-ui CheckboxRoot and CheckboxIndicator, as the shadcn-vue Checkbox.