Checkbox

Examples

Controlled Checkbox

Copied to clipboard

Uncontrolled Checkbox

Copied to clipboard

Disabled Checkbox

Copied to clipboard

Custom label Checkbox

Copied to clipboard

Checkbox Props

The Checkbox component accepts the following props.

NameTypeRequiredDefaultDescription
className
string
''Additional classes added to the Checkbox.
isValid
bool
trueFlag to show if the Checkbox selection is valid or invalid.
isDisabled
bool
falseFlag to show if the Checkbox is disabled.
isChecked
bool
nullFlag to show if the Checkbox is checked.
onChange
func
() => undefinedA callback for when the Checkbox selection changes.
label
string | node
undefinedLabel text of the checkbox.
id
string
Id of the checkbox.
aria-label
any
Aria-label of the checkbox.