1. Government Frontend Component Guide
  2. Form radio button
  3. With heading

Form radio button example

With heading

This adds a legend element containing the text supplied.

How it looks

Are you hungry?

How to call this example

<%= render "govuk_publishing_components/components/radio", {
  name: "radio-group-heading",
  heading: "Are you hungry?",
  items: [
    {
      value: "yes",
      text: "Yes"
    },
    {
      value: "no",
      text: "No"
    }
  ]
} %>