Skip to content
  • System
  • Light
  • Dark
  • High contrast

Checkbox

import { Checkbox } from '@eekodigital/raster';

<Checkbox label="Send me a summary email" name="email_summary" />
Notify me about
<CheckboxGroup legend="Notify me about">
  <Checkbox label="New reports" name="notify_reports" />
  <Checkbox label="Criterion status changes" name="notify_status" />
  <Checkbox label="Report locks and unlocks" name="notify_locks" />
</CheckboxGroup>
Notify me aboutYou can change this later in settings.Error: Select at least one notification type.
<CheckboxGroup
  legend="Notify me about"
  hint="You can change this later in settings."
  error="Select at least one notification type."
>
  <Checkbox label="New reports" name="notify_reports" />
  <Checkbox label="Criterion status changes" name="notify_status" />
</CheckboxGroup>
PropTypeDescription
labelstringLabel rendered to the right of the checkbox.
checkedboolean | ‘indeterminate’Controlled checked state.
defaultCheckedbooleanInitial checked state (uncontrolled).
onCheckedChange(checked: boolean | ‘indeterminate’) => voidCalled when checked state changes.
disabledbooleanDisables the checkbox.
namestringForm field name for submission.
PropTypeDescription
legendstring

Group label rendered as a <legend>.

hintstringOptional hint text.
errorstringValidation error message for the group.
childrenReactNode

Checkbox components.