Form checkboxes example

With custom hint text

Hint text defaults to ‘Select all that apply’ but can be overridden with this option. Note that a hint (and a heading) is only displayed if there is more than one checkbox.

How it looks (preview)

What is your favourite skittle?
Taste the rainbow

How to call this example

<%= render "govuk_publishing_components/components/checkboxes", {
  name: "favourite_skittle[]",
  heading: "What is your favourite skittle?",
  hint_text: "Taste the rainbow",
  items: [
    {
      label: "Red",
      value: "red"
    },
    {
      label: "Green",
      value: "green"
    },
    {
      label: "Blue",
      value: "blue"
    }
  ]
} %>