There are two tag helpers for the button component. <govuk-button>
generates a <button>
element; <govuk-button-link>
generates an 'a' element.
<govuk-button type="submit">Save and continue</govuk-button>
<govuk-button class="govuk-button--secondary">Cancel</govuk-button>
<govuk-button-link is-start-button="true" href="/start">Start</govuk-button>
<govuk-button disabled="true">Save and continue</govuk-button>
<govuk-button-link href="/">Confirm</govuk-button>
<govuk-button-link asp-controller="Home" asp-action="Confirm">Confirm</govuk-button>
<govuk-button type="submit" asp-controller="Home" asp-action="Confirm">Confirm</govuk-button>
The content is the HTML to use within the generated button.
Attribute | Type | Description |
---|---|---|
disabled |
bool |
Whether the button should be disabled. The default is false . |
id |
string |
The id attribute for the button. |
is-start-button |
bool |
Whether this button is the main call to action on your service's start page. The default is false . |
prevent-double-click |
bool |
Whether to prevent accidental double clicks on submit buttons from submitting forms multiple times. The default is false but can be configured globally by setting the DefaultButtonPreventDoubleClick property on GovUkFrontendAspNetCoreOptions . |
type |
string |
The type attribute for the generated button element. |
(link attributes) | If specified generates a formaction attribute using the specified values. See documentation on links for more information. |
The content is the HTML to use within the generated link.
Attribute | Type | Description |
---|---|---|
disabled |
bool |
Whether the button should be disabled. The default is false . |
id |
string |
The id attribute for the button. |
is-start-button |
bool |
Whether this button is the main call to action on your service's start page. The default is false . |
(link attributes) | If specified generates an href attribute using the specified values. See documentation on links for more information. |