Checkbox

Zero or more choices out of a set, each independent. The indeterminate state is a parent's summary of its children, not a third value.

Basic

A Checkbox is checked, unchecked or, with indeterminate, partly checked, like a select-all box with some items picked.

Disabled

Set disabled to lock a checkbox in its current state, whether checked, unchecked or indeterminate.

Controlled

Pass checked and onChange to drive the checkbox from state, here checked and disabled by the buttons below it.

Group

Pass Checkbox.Group a list of options, and set disabled on any option that cannot be picked.

Vertical

Set orientation="vertical", or the vertical shorthand, to stack a group's options in a column.

Check all

Set indeterminate on a select-all box while only part of the group is checked, and check or clear the whole group from it.

Group in a grid

Put checkboxes with a value anywhere inside Checkbox.Group, here laid out in a three-column grid.

With description

Pass a title and a line of help text as the label, with the box aligned to the first line.

Card options

Wrap each checkbox of a group in a card to make large options with a title and a description.

Nested groups

For nested checkboxes, use a checkable Tree, which checks each parent when all its children are and marks it indeterminate when some are.

In a form

Use Checkbox.Group as a form field, and set valuePropName="checked" for a single checkbox like accepting the terms.

API Reference

Checkbox
Checkbox's props. Rows marked antuikit in the Version column are added by the kit.
Checkbox.Group
Checkbox.Group's props. Rows marked antuikit in the Version column are added by the kit.