1. Government Frontend Component Guide
  2. Form radio button
  3. With custom id prefix

Form radio button example

With custom id prefix

How it looks

How to call this example

<%= render "govuk_publishing_components/components/radio", {
  id_prefix: "custom",
  name: "radio-custom-id-prefix",
  items: [
    {
      value: "government-gateway",
      text: "Use Government Gateway"
    },
    {
      value: "govuk-verify",
      text: "Use GOV.UK Verify"
    }
  ]
} %>