Skip to content

Checkbox

import { Checkbox } from 'yarcl';
<Checkbox defaultChecked>Email notifications</Checkbox>
<Checkbox indeterminate>Select all</Checkbox>
<Checkbox color="success" size="lg">Large, success</Checkbox>
  • It’s a native <input type="checkbox">, so checked, defaultChecked and onChange work as usual.
  • The box is sized from the size’s iconSize.
  • indeterminate shows a mixed state; the browser clears it when the user toggles the box.

Accepts every native <input> attribute except type, color and size.

PropTypeDefaultDescription
childrenReactNodeLabel shown next to the box.
colorColorconfigconfig.defaults.colorColor of the checked box, from the colors config.
indeterminatebooleanShows a mixed state. Cleared by the browser when the user toggles the box.
sizeSizeconfigconfig.defaults.sizeBox size, from the sizes config (uses the size's iconSize).