Fieldset
Code
Markup
<fieldset class="govuk-fieldset">
<legend class="govuk-fieldset__legend">
What is your address?
</legend>
</fieldset>
Macro
{% from "govuk/components/fieldset/macro.njk" import govukFieldset %}
{{ govukFieldset({
legend: {
text: "What is your address?"
}
}) }}
Fieldset styled as xl text
Code
Markup
<fieldset class="govuk-fieldset">
<legend class="govuk-fieldset__legend govuk-fieldset__legend--xl">
What is your address?
</legend>
</fieldset>
Macro
{% from "govuk/components/fieldset/macro.njk" import govukFieldset %}
{{ govukFieldset({
legend: {
text: "What is your address?",
classes: "govuk-fieldset__legend--xl"
}
}) }}
Fieldset styled as large text
Open this example in a new tab: fieldset styled as large text
Code
Markup
<fieldset class="govuk-fieldset">
<legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
What is your address?
</legend>
</fieldset>
Macro
{% from "govuk/components/fieldset/macro.njk" import govukFieldset %}
{{ govukFieldset({
legend: {
text: "What is your address?",
classes: "govuk-fieldset__legend--l"
}
}) }}
Fieldset styled as medium text
Open this example in a new tab: fieldset styled as medium text
Code
Markup
<fieldset class="govuk-fieldset">
<legend class="govuk-fieldset__legend govuk-fieldset__legend--m">
What is your address?
</legend>
</fieldset>
Macro
{% from "govuk/components/fieldset/macro.njk" import govukFieldset %}
{{ govukFieldset({
legend: {
text: "What is your address?",
classes: "govuk-fieldset__legend--m"
}
}) }}
Fieldset styled as small text
Open this example in a new tab: fieldset styled as small text
Code
Markup
<fieldset class="govuk-fieldset">
<legend class="govuk-fieldset__legend govuk-fieldset__legend--s">
What is your address?
</legend>
</fieldset>
Macro
{% from "govuk/components/fieldset/macro.njk" import govukFieldset %}
{{ govukFieldset({
legend: {
text: "What is your address?",
classes: "govuk-fieldset__legend--s"
}
}) }}
Fieldset as page heading xl
Code
Markup
<fieldset class="govuk-fieldset">
<legend class="govuk-fieldset__legend govuk-fieldset__legend--xl">
<h1 class="govuk-fieldset__heading">
What is your address?
</h1>
</legend>
</fieldset>
Macro
{% from "govuk/components/fieldset/macro.njk" import govukFieldset %}
{{ govukFieldset({
legend: {
text: "What is your address?",
classes: "govuk-fieldset__legend--xl",
isPageHeading: true
}
}) }}
Fieldset as page heading l
Code
Markup
<fieldset class="govuk-fieldset">
<legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
<h1 class="govuk-fieldset__heading">
What is your address?
</h1>
</legend>
</fieldset>
Macro
{% from "govuk/components/fieldset/macro.njk" import govukFieldset %}
{{ govukFieldset({
legend: {
text: "What is your address?",
classes: "govuk-fieldset__legend--l",
isPageHeading: true
}
}) }}
Fieldset as page heading m
Code
Markup
<fieldset class="govuk-fieldset">
<legend class="govuk-fieldset__legend govuk-fieldset__legend--m">
<h1 class="govuk-fieldset__heading">
What is your address?
</h1>
</legend>
</fieldset>
Macro
{% from "govuk/components/fieldset/macro.njk" import govukFieldset %}
{{ govukFieldset({
legend: {
text: "What is your address?",
classes: "govuk-fieldset__legend--m",
isPageHeading: true
}
}) }}
Fieldset as page heading s
Code
Markup
<fieldset class="govuk-fieldset">
<legend class="govuk-fieldset__legend govuk-fieldset__legend--s">
<h1 class="govuk-fieldset__heading">
What is your address?
</h1>
</legend>
</fieldset>
Macro
{% from "govuk/components/fieldset/macro.njk" import govukFieldset %}
{{ govukFieldset({
legend: {
text: "What is your address?",
classes: "govuk-fieldset__legend--s",
isPageHeading: true
}
}) }}
Fieldset as page heading without class
Open this example in a new tab: fieldset as page heading without class
Code
Markup
<fieldset class="govuk-fieldset">
<legend class="govuk-fieldset__legend">
<h1 class="govuk-fieldset__heading">
What is your address?
</h1>
</legend>
</fieldset>
Macro
{% from "govuk/components/fieldset/macro.njk" import govukFieldset %}
{{ govukFieldset({
legend: {
text: "What is your address?",
isPageHeading: true
}
}) }}