A small box that users can check or uncheck
| Prop | Type | Description |
|---|---|---|
| onChange | () => void | onChane property |
| checked? | boolean | Initial checkbox value |
| children? | React.Node | Accpets children to render |
| error? | string | Error message |
import { Checkbox } from "@brick-uikit/input";Checkboxes allow users to select one or more options from a list. You can control their state using the `checked` property and handle changes with the `onChange` callback. The `error` property can display validation messages, and `children` allows you to render a label next to the checkbox.
You must accept terms to continue
example.tsx
<Checkbox
onChange={handleChange}
checked
>
Accept terms and conditions
</Checkbox>
<Spacer top={1}/>
<Checkbox
onChange={handleChange}
error="You must accept terms to continue"
>
Accept terms and conditions
</Checkbox>