<Checkbox
defaultChecked={true}
label="Click me to select!"
onChange={(e, state) => {
console.log(e, state.checked, state.value);
}}
/>
Checkbox Props
Uncontrolled check state.
Helper text description below the checkbox.
icons
{ checked?: Svg, indeterminate?: Svg, unchecked?: Svg }
Overrides for default icons.
Sets the checkbox to an indeterminate state.
The label should have accessible string content.
onChange
(e: ChangeEvent<HTMLInputElement>, state?: CheckboxState) => void
Callback when the checkbox is changed.
onClick
(e?: MouseEvent<HTMLInputElement>, state?: CheckboxState) => void
Callback when the checkbox is clicked.
<Checkbox.Group direction="column" legend="Checkbox Group">
<Checkbox label="Checkbox 1" defaultChecked />
<Checkbox label="Checkbox 2" />
<Checkbox label="Checkbox 3" />
</Checkbox.Group>
Checkbox.Group Props
legend
ReactElement | string
required
The legend for the checkbox group. Supports inline markdown formatting.Passing ReactElement is deprecated — use a plain string with inline markdown instead.
flexDirection
"column" | "row"
default:"column"
The direction that the checkboxes are organized. This is inherited from LayoutUtilProps.
Visually hides the legend while keeping it accessible to screen readers.