{{ aspExample({ code: "<button type=\"submit\" class=\"button button–start\">Send sign in details</button>", nunjucks: "{{ aspButton({
modifier: \"start\",
type: \"submit\",
text: \"Start\"
}) }}", title: "", id: "65a92ae12942e", url: "" }) }}

Use the default button for the most important action on a page. For example, the ‘Start’ button on a form’s start page. Only use one primary button per page to guide users to the main action.

Button as a link

{{ aspExample({ code: "", nunjucks: "{{ aspButton({
modifier: \"start\",
href: \"#\",
text: \"Start now\"
}) }}", title: "", id: "66e01a32f16dc", url: "" }) }}

Disabled button

Disabled buttons have poor contrast and can confuse some users, so avoid them if possible.

Only use disabled buttons if research shows it makes the user interface easier to understand. disabled buttons should be used when an action is possible but not available, and should be styled differently from active buttons.

{{ aspExample({ code: "", nunjucks: "{{ aspButton({
modifier: \"start\",
type: \"submit\",
disabled: true,
text: \"Start\"
}) }}", title: "", id: "6729f88e89cca", url: "" }) }}

When to use this component

Use the button component to help users carry out an action like starting an application or saving their information.

How it works

Write button text in sentence case, describing the action it performs. For example:

You may need to include more or different words to better describe the action. For example, ‘Send sign in details’.

Align the primary action button to the left edge of your form.

Secondary button

The secondary button is for less important actions and usually sits next to the primary button.

Avoid adding multiple secondary buttons to one page, as it can confuse users. Instead, try to simplify or spread content across multiple pages.

{{ aspExample({ code: "", nunjucks: "{{ aspButton({
modifier: \"secondary\",
type: \"button\",
text: \"Secondary action\"
}) }}", title: "", id: "6729f88e89d02", url: "" }) }}

Warning button

Warning buttons are designed to make users think carefully before they use them. They only work if used very sparingly. Most services should not need one.

{{ aspExample({ code: "<button type=\"submit\" class=\"button button–warning\">Send sign in details</button>", nunjucks: "{{ aspButton({
modifier: \"warning\",
type: \"reset\",
text: \"Delete\"
}) }}", title: "", id: "65a92ae1294a4", url: "" }) }}

Primary button

The blue button is not recommended for new designs. It has been used in some applications such as Formation Admin, but its purpose is unclear.

It was previously considered a secondary button but is coded as a primary button. Its future use is under review.

{{ aspExample({ code: "<button type=\"submit\" class=\"button button–primary\">Send sign in details</button>", nunjucks: "{{ aspButton({
modifier: \"primary\",
type: \"button\",
text: \"Download\"
}) }}", title: "", id: "65a92ae129483", url: "" }) }}

Status of development

The below criteria all need to be met for a component to be considered as fully developed for use within the ASP Digital Design System.


{{ aspTable({
head: [
{ text: 'Development criteria'},
{ text: 'Status'}
],
rows: [
{
cells: [
{ text: 'WCAG 2.2 compliant'},
{ html: '<span class="status">Not started</span>'}
]
},
{
cells: [
{ text: 'WCAG 2.1 compliant'},
{ html: '<span class="status status–green">Completed</span>'}
]
},
{
cells: [
{ text: 'HTML / Nunjucks version'},
{ html: '<span class="status status–green">Completed</span>'}
]
},
{
cells: [
{ text: 'Figma version'},
{ html: '<span class="status status">Not started</span>'}
]
},
{
cells: [
{ text: 'M365 versions'},
{ html: '<span class="status status">Not started</span>'}
]
},
{
cells: [
{ text: 'Documentation'},
{ html: '<span class="status status–yellow">In progress</span>'}
]
}
]
}) }}