1. Collections Component Guide
  2. Form fieldset
  3. With custom legend size
Form fieldset example

With custom legend size

Make the legend different sizes. Valid options are ‘s’, ‘m’, ‘l’ and ‘xl’.

How it looks (preview)

Do you have a driving license?

How to call this example

<%= render "govuk_publishing_components/components/fieldset", {
  legend_text: "Do you have a driving license?",
  heading_size: "l"
} do %>
  <!-- Use the radio component, this is hardcoded only for this example -->
  <input type="radio" id="size-yes" name="default">
  <label for="size-yes">Yes</label>

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