Skip to content

KCheckbox

A group of options for multiple choices.

Install

bash
pnpm add @ikun-ui/checkbox
bash
yarn add @ikun-ui/checkbox
bash
npm install @ikun-ui/checkbox

Basic usage

Checkbox can be used alone to switch between two states.

Disabled checkbox

Set the disabled attribute.

Sizes

Add size attribute to change the size of Checkbox. It supports sm, md and lg.

Checkbox group

It is used for multiple checkboxes which are bound in one group, and indicates whether one option is selected by checking if it is checked.
Bind an array of string or number type to the checkboxGroup component and pass the checkbox component as a slot. At the same time, uid must be passed to the checkbox component to mark its uniqueness.

Indeterminate

The indeterminate property can help you to achieve a 'check all' effect.

Checkbox Props

NameTypeDefaultDescription
labelstring-Label of the checkbox
valuebooleanfalseBinding value
checkColorstring-Icon color when selected
bgCheckColor string-Background color when selected
bgUnCheckColor string-Background color when not selected
uidstring-The unique value of the checkbox component, must be passed when wrapped by checkboxGroup
sizesm | md | lgmdsize of checkbox.
disabledbooleanfalseWhether the checkbox is disabled
indeterminatebooleanfalseDetermine whether it is an intermediate state
clsstring-Additional class
attrsRecord<string, string>{}Additional attributes

Checkbox Events

NameDescriptionType
updateValueEvent fired when the value is changes(value: Event)=> void

Checkbox Slots

NameDescription
defaultCustomize label content

Checkbox Group Props

NameTypeDefaultDescription
valueArray<string | number>-Binding value,Its elements must be consistent with the uid of the checkbox component
sizesm | md | lgmdsize of checkbox
disabledbooleanfalseWhether the checkboxGroup is disabled
clsstring-Additional class
attrsRecord<string, string>{}Additional attributes

Checkbox Group Events

NameDescriptionType
updateValueEvent fired when the value is changes(value: CustomEvent)=> void

Checkbox Group Slots

NameDescription
defaultPlease pass in the checkbox component

MIT Licensed