Fieldset
Read more about the
fieldset
component on the Gov.UK Design System website
@using GovUkDesignSystemDotNet
@await Html.GovUkFieldset(new FieldsetViewModel
{
Legend = new FieldsetLegendViewModel
{
HtmlOrText = new HtmlOrText("What is your address?"),
Classes = ["govuk-fieldset__legend--l"],
IsPageHeading = true
},
HtmlOrText = new HtmlOrText(
@<text>
@await Html.GovUkTextInput(new TextInputViewModel
{
Name = "address-line-1",
Label = new LabelViewModel
{
HtmlOrText = new HtmlOrText("Address line 1")
}
})
@await Html.GovUkTextInput(new TextInputViewModel
{
Name = "town-city",
Label = new LabelViewModel
{
HtmlOrText = new HtmlOrText("Town or city")
}
})
@await Html.GovUkTextInput(new TextInputViewModel
{
Name = "postcode",
Label = new LabelViewModel
{
HtmlOrText = new HtmlOrText("Postcode")
}
})
</text>)
})
Options
Options for FieldsetViewModel
|
List<string>
|
One or more element IDs to add to the input aria-describedby attribute,
used to provide additional descriptive information for screenreader users.
|
|
FieldsetLegendViewModel
|
The legend for the fieldset component.
See options for FieldsetLegendViewModel
|
|
List<string>
|
Classes to add to the fieldset container.
|
|
string
|
Optional ARIA role attribute.
|
|
Dictionary<string, string>
|
HTML attributes (for example data attributes) to add to the fieldset container.
|
|
HtmlOrText
|
HTML or text to use/render within the fieldset element.
|
Options for FieldsetLegendViewModel
|
HtmlOrText
|
Required.
HTML or text to use within the legend.
|
|
List<string>
|
Classes to add to the legend.
|
|
bool
|
Whether the legend also acts as the heading for the page.
|