1. Collections Component Guide
  2. Form fieldset
  3. With id attribute
Form fieldset example

With id attribute

How it looks (preview)

Do you have a passport?

How to call this example

<%= render "govuk_publishing_components/components/fieldset", {
  legend_text: "Do you have a passport?",
  id: "passports"
} do %>
  <!-- example content -->
  <%= render "govuk_publishing_components/components/radio", {
    name: "passport",
    items: [
      {
        value: "passport-yes",
        text: "Yes"
      },
      {
        value: "passport-no",
        text: "No"
      }
    ]
  } %>
  <!-- end of example content -->
<% end %>