CheckboxField
Forms & Input

CheckboxField

Labeled form checkbox built on a visually hidden native input, with native form and keyboard semantics and an optional description line.

Props

CheckboxField extends HTMLAttributes<HTMLLabelElement>. Uses a visually-hidden <input type="checkbox"> so a click on the label text toggles the checkbox without the double-fire a button-based approach would cause.

CheckboxFieldProps props
PropTypeDefaultDescription
checkedboolean—Checked state.
onChange(checked: boolean) => void—Toggle handler.
indeterminateboolean—Renders the mixed dash, aria-checked='mixed'.
disabledboolean—Prevents interaction.
childrenReactNode—Label text.
descriptionReactNode—Dim secondary line below the label.

Examples

Basic labeled

Basic CheckboxField

With description

CheckboxField with description

Disabled

Disabled CheckboxField
ImportTSX
import { CheckboxField } from "@solarius/onset";
import type { CheckboxFieldProps } from "@solarius/onset";