Dot Checkbox
Ticking it fills the box with the accent and draws the tick across it a dot at a time, the way a pen would; unticking dissolves the fill away. A part-ticked box, standing for a group only some of which are ticked, shows a dash. A real checkbox lies under it, so Space, screen readers and the label all work as usual.
Needs: None. Canvas 2D over a native checkbox.
Customize
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| checked | boolean | – | Ticked or not. Leave unset to let it keep its own. |
| defaultChecked | boolean | false | Ticked at first, when checked isn't set. |
| indeterminate | boolean | false | Part-ticked: shows a dash. |
| onChange | (checked: boolean) => void | – | Called with the new state. |
| children | ReactNode | – | The label beside the box. |
| tone | string | – | The box's colour when ticked. The page's accent by default. |
| pitch | number | 3 | Size of one dot in px. The box is 11 dots square. |
| disabled | boolean | false | Can't be changed. |
| label | string | – | For screen readers, when there's no visible label. |
| className | string | – | Class on the checkbox's label. |
| style | CSSProperties | – | Style on the checkbox's label. |