Checkbox

Checkboxes let users select one or more options from a choice of list.

Default

A simple checkbox example.

Group

Checkbox.Group help to manage state of checkboxes in a list.

Disabled

Checkbox allow to disabled to prevent user execute click event.

Vertical

Checkbox list can display in vertical too.

Color

Checkbox & group able to apply custom color via checboxClass prop.

API

Checkbox
PropDescriptionTypeDefault
checkedWhether the Checkbox is checkedboolean-
defaultCheckedWhether the Checkbox initial state is checkedboolean-
disabledWhether the Checkbox is disabledboolean-
valueThe value of the selected state (only valid when Checkbox.Group or the binding object type is array)string | number-
labelRefRef of Checkbox label elementstring-
checkboxClassCustom css for Checkboxstring-
onChangeCallback when Checkbox value is changed(checked: boolean, e: MouseEvent) => void-
nameThe name of the Checkbox input fieldstring-
Checkbox.Group
PropDescriptionTypeDefault
verticalDisplay list of checkbox in verticalbooleanfalse
colorCustom color for all checkboxes in the group, available colors option based on tailwind theme.colorsstringcurrent theme color
valueSpecify selected value of checkboxesstring[] | number[]-
onChangeCallback when value is changed(values: string[] | number[], e: MouseEvent) => void-
nameName of all checkboxes input field under the groupstring-