Checkbox

Type: React component

Toggles a single boolean value, rendering a square border, and a check mark when checked (true). It can also be (programmatically) set to the "indeterminate" state (by specifying "indeterminate" as its value). This is rendered as a square border with a minus sign in it.

When you need to implement multiple Checkbox components for the same piece of data (selecting several options in a list), consider using a CheckboxGroup instead.

Keyboard behavior:

  • Enter: call the onChange prop when focused and isDisabled is false.

Props

  1. isDisabled

    (Optional)

    Default value

  2. label

    (Optional)

    Type: Any

    Either a string, for which a Label component is used to render that string, or any valid ReactNode, which is rendered directly.

    Default value

  3. name

    (Optional)

    Type: FDS~Name

    Default value

  4. onChange

    (Required)

  5. tooltipContent

    (Optional)

    Default value

  6. validate

    (Optional)

    Default value

  7. value

    (Optional)

    Type: Boolean | String

    Either true or false (booleans) or "indeterminate" (string), defaults to false. When toggling a checkbox that is "indeterminate" it becomes true. Note: you can use the const Checkbox.VALUE_INDETERMINATE to ensure you spell "indeterminate" correctly.

    Default value