1. Collections Component Guide
  2. Form checkboxes
  3. Checkbox items with error
Form checkboxes example

Checkbox items with error

How it looks (preview)

What is your nationality? If you have dual nationality, select all options that are relevant to you. Select if you are British, Irish or a citizen of a different country
  • including English, Scottish, Welsh and Northern Irish

How to call this example

<%= render "govuk_publishing_components/components/checkboxes", {
  name: "nationality",
  heading: "What is your nationality?",
  error: "Select if you are British, Irish or a citizen of a different country",
  hint_text: "If you have dual nationality, select all options that are relevant to you.",
  items: [
    {
      label: "British",
      value: "british",
      hint: "including English, Scottish, Welsh and Northern Irish"
    },
    {
      label: "Irish",
      value: "irish"
    },
    {
      label: "Other",
      value: "other"
    }
  ]
} %>