1. Component Guide
  2. Form checkboxes
  3. With custom heading size
Form checkboxes example

With custom heading size

This allows the size of the legend to be changed. Valid options are s, m, l, xl, defaulting to m if no option is passed.

If the is_page_heading option is true and heading_size is not set, the text size will be xl.

How it looks (preview)

What is your favourite colour?
Select all that apply.

How to call this example

<%= render "govuk_publishing_components/components/checkboxes", {
  name: "favourite_colour[]",
  heading: "What is your favourite colour?",
  heading_size: "s",
  items: [
      label: "Red",
      value: "red"
      label: "Green",
      value: "green"
      label: "Blue",
      value: "blue"
} %>