1. Collections Component Guide
  2. Form checkboxes
  3. With a heading on one checkbox
Form checkboxes example

With a heading on one checkbox

One checkbox does not require a fieldset and therefore does not require a legend. However, if a heading is supplied, a fieldset will be included in the component and the heading used as the legend, as shown.

How it looks (preview)

Please tick the box to agree Select all that apply.

How to call this example

<%= render "govuk_publishing_components/components/checkboxes", {
  name: "agree",
  heading: "Please tick the box to agree",
  items: [
    {
      label: "I agree",
      value: "agree"
    }
  ]
} %>