Skip to Content
DocumentationCheckbox

Checkbox

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

Examples

Regular

Disabled

Uncheck Icon

With Description

API

Checkbox

PropertyTypeDefaultDescription
asChildbooleanfalseChange the default rendered element for the one passed as a child, merging their props and behavior.
defaultCheckedboolean-The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.
checkedboolean | “indeterminate”-The controlled checked state of the checkbox. Must be used in conjunction with onCheckedChange.
onCheckedChange(checked: boolean | “indeterminate”) => void-Event handler called when the checked state of the checkbox changes.
disabledboolean-When true, prevents the user from interacting with the checkbox.
requiredboolean-When true, indicates that the user must check the checkbox before the owning form can be submitted.
namestring-The name of the checkbox. Submitted with its owning form as part of a name/value pair.
valuestring”on”The value given as data when submitted with a name.
variant”regular""regular”The visual style of the checkbox.
size”sm” | “md” | “lg""md”The size of the checkbox.
uncheckIconbooleanfalseWhen true, displays a minus icon instead of a check icon when checked.
Data attributeValues
[data-state]“checked” | “unchecked” | “indeterminate”
[data-disabled]Present when disabled
Last updated on