Skip to content

Checkbox

<ts-checkbox> vv0.4.0

The ts-checkbox component.

Open in Storybook for interactive demos.

<ts-checkbox size="md">Content</ts-checkbox>
PropertyAttributeTypeDefaultDescription
checkedcheckedbooleanfalseWhether the checkbox is checked.
disableddisabledbooleanfalseRenders the checkbox as disabled.
errorerrorbooleanfalseRenders the checkbox in an error state.
indeterminateindeterminatebooleanfalseWhether the checkbox is in an indeterminate state.
labellabelstring | undefinedLabel text. If omitted, use the default slot.
namenamestring | undefinedName attribute for form submission.
sizesize"lg" | "md" | "sm"'md'The checkbox size.
valuevaluestring''The value associated with this checkbox.
EventDetailBubblesComposedDescription
tsChangeTsCheckboxChangeEventDetailYesYesEmitted when the checked state changes.
MethodSignatureDescription
toggletoggle() => Promise<void>Programmatically toggle the checkbox.
NameDescription
*(default)*Default slot for the checkbox label.

Use ::part() to style internal elements:

PartDescription
baseThe checkbox container.
controlThe visual checkbox box.
labelThe label wrapper.
ts-checkbox::part(base) {
/* your custom styles */
}
<ts-checkbox size="md">Content</ts-checkbox>
import { TsCheckbox } from '@tessera-ui/react';
<TsCheckbox size="md">Content</TsCheckbox>