Homelogologo
Sponsor

Checkbox

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

Usage

Used to allow users to select one or more options from a set.

import { Checkbox, Icon } from "@elemnts-ui/react"; <Checkbox.Root> <Checkbox.Control> <Checkbox.Indicator> <Icon icon="tabler:check" /> </Checkbox.Indicator> </Checkbox.Control> <Checkbox.Label>Accept terms</Checkbox.Label> <Checkbox.HiddenInput /> </Checkbox.Root>;

Checkbox Group

Use the Checkbox.Group component to group related checkboxes together.

API Reference

Checkbox

The root component for the checkbox.

PropTypeDefault
asChildbooleanfalse
checkedCheckedState-
defaultCheckedCheckedState-
disabledbooleanfalse
formstring-
idstring-
idsPartial<{ root: string; hiddenInput: string; control: string; label: string }>-
invalidbooleanfalse
namestring-
onCheckedChange(details: CheckedChangeDetails) => void-
readOnlybooleanfalse
requiredbooleanfalse
valuestring"on"

CheckboxControl

The visual control for the checkbox.

PropTypeDefault
asChildbooleanfalse

CheckboxIndicator

Displays when the checkbox is checked or indeterminate.

PropTypeDefault
asChildbooleanfalse
indeterminatebooleanfalse

CheckboxLabel

The label for the checkbox.

PropTypeDefault
asChildbooleanfalse

CheckboxHiddenInput

The hidden input used for form submission and accessibility.

PropTypeDefault
asChildbooleanfalse

CheckboxRootProvider

Provides a checkbox state machine created with useCheckbox.

PropTypeDefault
valueUseCheckboxReturnrequired
asChildbooleanfalse

CheckboxGroup

Used to group related checkboxes together.

PropTypeDefault
asChildbooleanfalse
defaultValuestring[]-
disabledbooleanfalse
invalidbooleanfalse
maxSelectedValuesnumber-
namestring-
onValueChange(value: string[]) => void-
readOnlybooleanfalse
valuestring[]-

CheckboxGroupProvider

Provides a checkbox group state machine created with useCheckboxGroup.

PropTypeDefault
valueUseCheckboxGroupContextrequired
asChildbooleanfalse