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 %>
  <!-- Use the radio component, this is hardcoded only for this example -->
  <input type="radio" id="passport-yes" name="default">
  <label for="passport-yes">Yes</label>

  <input type="radio" id="passport-no" name="default">
  <label for="passport-no">No</label>
<% end %>