FORMS / COMPONENT 13

Checkbox

React component

Select an independent option or represent partial selection.

Try it out

Use the live controls or open the Code tab to view and copy the example.

News worth opening your inbox for.
Highlights delivered every Monday.
Indeterminate selection.

API reference

Generated from the package’s TypeScript exports. Standard React event and ARIA attributes are also accepted where the component wraps a native element.

PropTypeDescription
indeterminateboolean | undefinedSee the typed definition and working example for this option.
onCheckedChange((checked: boolean) => void) | undefinedCalled with the next checked state.
disabledboolean | undefinedDisables interaction (or date matchers for DatePicker).
namestring | undefinedField name used in form submission.
valuestring | number | readonly string[] | undefinedControlled value. Pair with its change callback.
defaultCheckedboolean | undefinedStandard React / HTML attribute passed to the underlying element.
defaultValuestring | number | readonly string[] | undefinedInitial value for uncontrolled usage.
classNamestring | undefinedAdditional CSS class names.
idstring | undefinedStandard React / HTML attribute passed to the underlying element.
styleCSSProperties | undefinedInline styles, including CSS custom property overrides.
relstring | undefinedStandard React / HTML attribute passed to the underlying element.
childrenReactNodeContent rendered inside the component.
onFocusFocusEventHandler<HTMLInputElement> | undefinedStandard React / HTML attribute passed to the underlying element.
onBlurFocusEventHandler<HTMLInputElement> | undefinedStandard React / HTML attribute passed to the underlying element.
onChangeChangeEventHandler<HTMLInputElement, HTMLInputElement> | undefinedStandard React / HTML attribute passed to the underlying element.
onErrorReactEventHandler<HTMLInputElement> | undefinedStandard React / HTML attribute passed to the underlying element.
onClickMouseEventHandler<HTMLInputElement> | undefinedStandard React / HTML attribute passed to the underlying element.
altstring | undefinedStandard React / HTML attribute passed to the underlying element.
autoCompleteHTMLInputAutoCompleteAttribute | undefinedStandard React / HTML attribute passed to the underlying element.
checkedboolean | undefinedStandard React / HTML attribute passed to the underlying element.
heightstring | number | undefinedStandard React / HTML attribute passed to the underlying element.
maxstring | number | undefinedStandard React / HTML attribute passed to the underlying element.
maxLengthnumber | undefinedStandard React / HTML attribute passed to the underlying element.
minstring | number | undefinedStandard React / HTML attribute passed to the underlying element.
minLengthnumber | undefinedStandard React / HTML attribute passed to the underlying element.
placeholderstring | undefinedStandard React / HTML attribute passed to the underlying element.
readOnlyboolean | undefinedStandard React / HTML attribute passed to the underlying element.
requiredboolean | undefinedParticipates in native form validation.
srcstring | undefinedStandard React / HTML attribute passed to the underlying element.
stepstring | number | undefinedStandard React / HTML attribute passed to the underlying element.
widthstring | number | undefinedStandard React / HTML attribute passed to the underlying element.
labelRequiredstringA meaningful visible or accessible label.
descriptionstring | undefinedSupporting instructions associated with the control.
errorstring | undefinedValidation message; also sets aria-invalid.
hideLabelboolean | undefinedSee the typed definition and working example for this option.

Accessibility & interaction

Use a persistent visible label and provide textual errors; native controls support keyboard input and browser form constraints.

Visible focus, reduced motion, and both color themes are shared across staqui. Choose labels and document structure that make sense in your application; automated checks do not replace assistive-technology testing.

Variants & implementation notes

Supports controlled/uncontrolled checked state and the native indeterminate property. Required and validation are native browser behavior.

Use the typed API above for the supported variants. The example demonstrates the primary composition; shared controls inherit hover, focus, active and disabled treatment where applicable.

Compose with