Skip to content

Checkbox

A control that allows the user to toggle between checked and not checked.

Basic Usage

Example

Checkbox Group

Use BrCheckboxGroup to group multiple checkboxes.

Selected: [ "apple" ]
Example

Indeterminate State

The indeterminate state is used when a checkbox's state is neither checked nor unchecked.

Example

Sizes

We provide a default set of sizes that you can control via the size prop.

Example

Disabled State

Disabled Group

Example

Theming

Global Customization (BrConfigProvider)

You can override default CSS variables via the theme prop of BrConfigProvider.

vue
<template>
  <BrConfigProvider :theme="{ primary: '#10B981', radius: 0.5 }">
    <BrCheckbox v-model="checked" label="Custom Theme" />
  </BrConfigProvider>
</template>

Local Customization (TailwindCSS)

You can directly override styles using TailwindCSS utility classes on the wrapper or via deep selectors if needed, but wrapper class is usually sufficient for layout.

vue
<template>
  <BrCheckbox class="mb-4" label="Margin Bottom" />
</template>

API

BrCheckbox

Props

NameTypeDefaultDescription
modelValueboolean | string | numberundefinedBinding value
valuestring | number | booleanundefinedValue of the checkbox (used in group)
disabledbooleanfalseWhether the checkbox is disabled
indeterminatebooleanfalseWhether the checkbox is in indeterminate state
labelstringundefinedLabel text
idstringundefinedInput id
namestringundefinedInput name
requiredbooleanfalseWhether the checkbox is required
errorbooleanfalseWhether the checkbox is in error state
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'default''default'Size of the checkbox

Emits

NameDescriptionParameters
update:modelValueUpdate model value(value: boolean | string | number)
changeChange event(value: boolean | string | number)

Slots

NameDescription
defaultLabel content
iconCustom icon slot

BrCheckboxGroup

Props

NameTypeDefaultDescription
modelValue(string | number)[][]Binding value array
disabledbooleanfalseWhether the group is disabled
size'sm' | 'default' | 'lg''default'Size of all checkboxes in the group
namestringundefinedName attribute for all checkboxes

Emits

NameDescriptionParameters
update:modelValueUpdate model value(value: (string | number)[])
changeChange event(value: (string | number)[])