Checkboxes

Last updated on
29 September 2017

Use when

  • Multiple checkboxes are appropriate when the user needs to select zero, one, or multiple options.
  • A stand-alone checkbox is suitable whenever a user should be permitted to turn a single option on or off.

Expample for Multiple checkboxes

Screenshot of checkboxes at node creation page

Example for a Stand-alone checkbox
Screenshot of a stand-alone checkbox on the account settings page

    Recommendations

    • If you have a large number of checkbox options, a select list with the #multiple property may be an alternative. However, this does not provide a very agreeable user experience, since users may not know how to select more than one item presented in this way, so better look for other ways to achieve the required functionality.
    • If labels for the description items in a stand-alone checkbox cannot readily include the words true/false or enable/disable, then it is better to use two radio buttons instead.

    Wording of labels and descriptions

    • The label for a radio button should be a statement or a descriptive phrase.
    • Avoid
      • beginning with "Enable …" or "Is…";
      • beginning with "Select to…" or "Choose to…" because these are usually redundant.
      • ending with a question mark or a period;
      • negative expressions such as "Don't show this on the page", as that means the user has to make sense of a double negative.

    API

    Checkboxes: Drupal 8, Drupal 7, Drupal 6
    Stand-alone checkbox: Drupal 8, Drupal 7, Drupal 6

    The problem this solves

    The user needs to select zero, one, or more options from a pre-defined set.