Button
These examples are used for automated tests and may not follow service manual best practice.
Button default
Code
Markup
<button class="nhsuk-button" data-module="nhsuk-button" type="submit">
Save and continue
</button>
Macro
Button default, small
Code
Markup
<button class="nhsuk-button nhsuk-button--small" data-module="nhsuk-button" type="submit">
Save and continue
</button>
Macro
Button disabled
Code
Markup
<button class="nhsuk-button" data-module="nhsuk-button" type="submit" disabled aria-disabled="true">
Disabled button
</button>
Macro
Button disabled, small
Code
Markup
<button class="nhsuk-button nhsuk-button--small" data-module="nhsuk-button" type="submit" disabled aria-disabled="true">
Disabled button
</button>
Macro
Button login
Code
Markup
<button class="nhsuk-button nhsuk-button--login" data-module="nhsuk-button" type="submit">
Continue
</button>
Macro
Button login as a link
Code
Markup
<a class="nhsuk-button nhsuk-button--login" data-module="nhsuk-button" href="#" role="button" draggable="false">
Continue
</a>
Macro
Button login as a link, small
Open this example in a new tab: Button login as a link, small
Code
Markup
<a class="nhsuk-button nhsuk-button--login nhsuk-button--small" data-module="nhsuk-button" href="#" role="button" draggable="false">
Continue
</a>
Macro
Button login disabled
Code
Markup
<button class="nhsuk-button nhsuk-button--login" data-module="nhsuk-button" type="submit" disabled aria-disabled="true">
Continue
</button>
Macro
Button login disabled, small
Open this example in a new tab: Button login disabled, small
Code
Markup
<button class="nhsuk-button nhsuk-button--login nhsuk-button--small" data-module="nhsuk-button" type="submit" disabled aria-disabled="true">
Continue
</button>
Macro
Button login class overriding variant option
Open this example in a new tab: Button login class overriding variant option
Code
Markup
<button class="nhsuk-button nhsuk-button--login" data-module="nhsuk-button" type="submit">
Continue
</button>
Macro
Button login, small
Code
Markup
<button class="nhsuk-button nhsuk-button--login nhsuk-button--small" data-module="nhsuk-button" type="submit">
Continue
</button>
Macro
Button login with icon at end
Open this example in a new tab: Button login with icon at end
Code
Markup
<button class="nhsuk-button nhsuk-button--login nhsuk-button--icon" data-module="nhsuk-button" type="submit">
<span class="nhsuk-button__content">Next</span>
<svg class="nhsuk-icon nhsuk-icon--arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="m14.7 6.3 5 5c.2.2.3.4.3.7 0 .3-.1.5-.3.7l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3H5a1 1 0 0 1 0-2h11.6l-3.3-3.3a1 1 0 1 1 1.4-1.4Z"/>
</svg>
</button>
Macro
Button login with icon at end, small
Open this example in a new tab: Button login with icon at end, small
Code
Markup
<button class="nhsuk-button nhsuk-button--login nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit">
<span class="nhsuk-button__content">Next</span>
<svg class="nhsuk-icon nhsuk-icon--arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="m14.7 6.3 5 5c.2.2.3.4.3.7 0 .3-.1.5-.3.7l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3H5a1 1 0 0 1 0-2h11.6l-3.3-3.3a1 1 0 1 1 1.4-1.4Z"/>
</svg>
</button>
Macro
Button login with icon at start
Open this example in a new tab: Button login with icon at start
Code
Markup
<button class="nhsuk-button nhsuk-button--login nhsuk-button--icon" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M10.7 6.3c.4.4.4 1 0 1.4L7.4 11H19a1 1 0 0 1 0 2H7.4l3.3 3.3c.4.4.4 1 0 1.4a1 1 0 0 1-1.4 0l-5-5A1 1 0 0 1 4 12c0-.3.1-.5.3-.7l5-5a1 1 0 0 1 1.4 0Z"/>
</svg>
<span class="nhsuk-button__content">Previous</span>
</button>
Macro
Button login with icon at start, small
Open this example in a new tab: Button login with icon at start, small
Code
Markup
<button class="nhsuk-button nhsuk-button--login nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M10.7 6.3c.4.4.4 1 0 1.4L7.4 11H19a1 1 0 0 1 0 2H7.4l3.3 3.3c.4.4.4 1 0 1.4a1 1 0 0 1-1.4 0l-5-5A1 1 0 0 1 4 12c0-.3.1-.5.3-.7l5-5a1 1 0 0 1 1.4 0Z"/>
</svg>
<span class="nhsuk-button__content">Previous</span>
</button>
Macro
Button reverse
Code
Markup
<button class="nhsuk-button nhsuk-button--reverse" data-module="nhsuk-button" type="submit">
Log out
</button>
Macro
Button reverse as a link
Code
Markup
<a class="nhsuk-button nhsuk-button--reverse" data-module="nhsuk-button" href="#" role="button" draggable="false">
Log out
</a>
Macro
Button reverse as a link, small
Open this example in a new tab: Button reverse as a link, small
Code
Markup
<a class="nhsuk-button nhsuk-button--reverse nhsuk-button--small" data-module="nhsuk-button" href="#" role="button" draggable="false">
Log out
</a>
Macro
Button reverse disabled
Code
Markup
<button class="nhsuk-button nhsuk-button--reverse" data-module="nhsuk-button" type="submit" disabled aria-disabled="true">
Log out
</button>
Macro
Button reverse disabled, small
Open this example in a new tab: Button reverse disabled, small
Code
Markup
<button class="nhsuk-button nhsuk-button--reverse nhsuk-button--small" data-module="nhsuk-button" type="submit" disabled aria-disabled="true">
Log out
</button>
Macro
Button reverse class overriding variant option
Open this example in a new tab: Button reverse class overriding variant option
Code
Markup
<button class="nhsuk-button nhsuk-button--reverse" data-module="nhsuk-button" type="submit">
Continue
</button>
Macro
Button reverse, small
Code
Markup
<button class="nhsuk-button nhsuk-button--reverse nhsuk-button--small" data-module="nhsuk-button" type="submit">
Log out
</button>
Macro
Button reverse with icon at end
Open this example in a new tab: Button reverse with icon at end
Code
Markup
<button class="nhsuk-button nhsuk-button--reverse nhsuk-button--icon" data-module="nhsuk-button" type="submit">
<span class="nhsuk-button__content">Next</span>
<svg class="nhsuk-icon nhsuk-icon--arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="m14.7 6.3 5 5c.2.2.3.4.3.7 0 .3-.1.5-.3.7l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3H5a1 1 0 0 1 0-2h11.6l-3.3-3.3a1 1 0 1 1 1.4-1.4Z"/>
</svg>
</button>
Macro
Button reverse with icon at end, small
Open this example in a new tab: Button reverse with icon at end, small
Code
Markup
<button class="nhsuk-button nhsuk-button--reverse nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit">
<span class="nhsuk-button__content">Next</span>
<svg class="nhsuk-icon nhsuk-icon--arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="m14.7 6.3 5 5c.2.2.3.4.3.7 0 .3-.1.5-.3.7l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3H5a1 1 0 0 1 0-2h11.6l-3.3-3.3a1 1 0 1 1 1.4-1.4Z"/>
</svg>
</button>
Macro
Button reverse with icon at start
Open this example in a new tab: Button reverse with icon at start
Code
Markup
<button class="nhsuk-button nhsuk-button--reverse nhsuk-button--icon" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M10.7 6.3c.4.4.4 1 0 1.4L7.4 11H19a1 1 0 0 1 0 2H7.4l3.3 3.3c.4.4.4 1 0 1.4a1 1 0 0 1-1.4 0l-5-5A1 1 0 0 1 4 12c0-.3.1-.5.3-.7l5-5a1 1 0 0 1 1.4 0Z"/>
</svg>
<span class="nhsuk-button__content">Previous</span>
</button>
Macro
Button reverse with icon at start, small
Open this example in a new tab: Button reverse with icon at start, small
Code
Markup
<button class="nhsuk-button nhsuk-button--reverse nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M10.7 6.3c.4.4.4 1 0 1.4L7.4 11H19a1 1 0 0 1 0 2H7.4l3.3 3.3c.4.4.4 1 0 1.4a1 1 0 0 1-1.4 0l-5-5A1 1 0 0 1 4 12c0-.3.1-.5.3-.7l5-5a1 1 0 0 1 1.4 0Z"/>
</svg>
<span class="nhsuk-button__content">Previous</span>
</button>
Macro
Button secondary
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary" data-module="nhsuk-button" type="submit">
Find my location
</button>
Macro
Button secondary as a link
Code
Markup
<a class="nhsuk-button nhsuk-button--secondary" data-module="nhsuk-button" href="#" role="button" draggable="false">
Find my location
</a>
Macro
Button secondary as a link, small
Open this example in a new tab: Button secondary as a link, small
Code
Markup
<a class="nhsuk-button nhsuk-button--secondary nhsuk-button--small" data-module="nhsuk-button" href="#" role="button" draggable="false">
Find my location
</a>
Macro
Button secondary disabled
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary" data-module="nhsuk-button" type="submit" disabled aria-disabled="true">
Find my location
</button>
Macro
Button secondary disabled, small
Open this example in a new tab: Button secondary disabled, small
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small" data-module="nhsuk-button" type="submit" disabled aria-disabled="true">
Find my location
</button>
Macro
Button secondary class overriding variant option
Open this example in a new tab: Button secondary class overriding variant option
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary" data-module="nhsuk-button" type="submit">
Continue
</button>
Macro
Button secondary, small
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small" data-module="nhsuk-button" type="submit">
Find my location
</button>
Macro
Button secondary, solid background
Open this example in a new tab: Button secondary, solid background
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary-solid" data-module="nhsuk-button" type="submit">
Find my location
</button>
Macro
Button secondary, solid background as a link
Open this example in a new tab: Button secondary, solid background as a link
Code
Markup
<a class="nhsuk-button nhsuk-button--secondary-solid" data-module="nhsuk-button" href="#" role="button" draggable="false">
Find my location
</a>
Macro
Button secondary, solid background as a link, small
Open this example in a new tab: Button secondary, solid background as a link, small
Code
Markup
<a class="nhsuk-button nhsuk-button--secondary-solid nhsuk-button--small" data-module="nhsuk-button" href="#" role="button" draggable="false">
Find my location
</a>
Macro
Button secondary, solid background disabled
Open this example in a new tab: Button secondary, solid background disabled
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary-solid" data-module="nhsuk-button" type="submit" disabled aria-disabled="true">
Find my location
</button>
Macro
Button secondary, solid background disabled, small
Open this example in a new tab: Button secondary, solid background disabled, small
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary-solid nhsuk-button--small" data-module="nhsuk-button" type="submit" disabled aria-disabled="true">
Find my location
</button>
Macro
Button secondary, solid background class overriding variant option
Open this example in a new tab: Button secondary, solid background class overriding variant option
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary-solid" data-module="nhsuk-button" type="submit">
Continue
</button>
Macro
Button secondary, solid background, small
Open this example in a new tab: Button secondary, solid background, small
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary-solid nhsuk-button--small" data-module="nhsuk-button" type="submit">
Find my location
</button>
Macro
Button secondary, solid background with icon at end
Open this example in a new tab: Button secondary, solid background with icon at end
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary-solid nhsuk-button--icon" data-module="nhsuk-button" type="submit">
<span class="nhsuk-button__content">Next</span>
<svg class="nhsuk-icon nhsuk-icon--arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="m14.7 6.3 5 5c.2.2.3.4.3.7 0 .3-.1.5-.3.7l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3H5a1 1 0 0 1 0-2h11.6l-3.3-3.3a1 1 0 1 1 1.4-1.4Z"/>
</svg>
</button>
Macro
Button secondary, solid background with icon at end, small
Open this example in a new tab: Button secondary, solid background with icon at end, small
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary-solid nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit">
<span class="nhsuk-button__content">Next</span>
<svg class="nhsuk-icon nhsuk-icon--arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="m14.7 6.3 5 5c.2.2.3.4.3.7 0 .3-.1.5-.3.7l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3H5a1 1 0 0 1 0-2h11.6l-3.3-3.3a1 1 0 1 1 1.4-1.4Z"/>
</svg>
</button>
Macro
Button secondary, solid background with icon at start
Open this example in a new tab: Button secondary, solid background with icon at start
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary-solid nhsuk-button--icon" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M10.7 6.3c.4.4.4 1 0 1.4L7.4 11H19a1 1 0 0 1 0 2H7.4l3.3 3.3c.4.4.4 1 0 1.4a1 1 0 0 1-1.4 0l-5-5A1 1 0 0 1 4 12c0-.3.1-.5.3-.7l5-5a1 1 0 0 1 1.4 0Z"/>
</svg>
<span class="nhsuk-button__content">Previous</span>
</button>
Macro
Button secondary, solid background with icon at start, small
Open this example in a new tab: Button secondary, solid background with icon at start, small
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary-solid nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M10.7 6.3c.4.4.4 1 0 1.4L7.4 11H19a1 1 0 0 1 0 2H7.4l3.3 3.3c.4.4.4 1 0 1.4a1 1 0 0 1-1.4 0l-5-5A1 1 0 0 1 4 12c0-.3.1-.5.3-.7l5-5a1 1 0 0 1 1.4 0Z"/>
</svg>
<span class="nhsuk-button__content">Previous</span>
</button>
Macro
Button secondary with icon at end
Open this example in a new tab: Button secondary with icon at end
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary nhsuk-button--icon" data-module="nhsuk-button" type="submit">
<span class="nhsuk-button__content">Next</span>
<svg class="nhsuk-icon nhsuk-icon--arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="m14.7 6.3 5 5c.2.2.3.4.3.7 0 .3-.1.5-.3.7l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3H5a1 1 0 0 1 0-2h11.6l-3.3-3.3a1 1 0 1 1 1.4-1.4Z"/>
</svg>
</button>
Macro
Button secondary with icon at end, small
Open this example in a new tab: Button secondary with icon at end, small
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit">
<span class="nhsuk-button__content">Next</span>
<svg class="nhsuk-icon nhsuk-icon--arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="m14.7 6.3 5 5c.2.2.3.4.3.7 0 .3-.1.5-.3.7l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3H5a1 1 0 0 1 0-2h11.6l-3.3-3.3a1 1 0 1 1 1.4-1.4Z"/>
</svg>
</button>
Macro
Button secondary with icon at start
Open this example in a new tab: Button secondary with icon at start
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary nhsuk-button--icon" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M10.7 6.3c.4.4.4 1 0 1.4L7.4 11H19a1 1 0 0 1 0 2H7.4l3.3 3.3c.4.4.4 1 0 1.4a1 1 0 0 1-1.4 0l-5-5A1 1 0 0 1 4 12c0-.3.1-.5.3-.7l5-5a1 1 0 0 1 1.4 0Z"/>
</svg>
<span class="nhsuk-button__content">Previous</span>
</button>
Macro
Button secondary with icon at start, small
Open this example in a new tab: Button secondary with icon at start, small
Code
Markup
<button class="nhsuk-button nhsuk-button--secondary nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M10.7 6.3c.4.4.4 1 0 1.4L7.4 11H19a1 1 0 0 1 0 2H7.4l3.3 3.3c.4.4.4 1 0 1.4a1 1 0 0 1-1.4 0l-5-5A1 1 0 0 1 4 12c0-.3.1-.5.3-.7l5-5a1 1 0 0 1 1.4 0Z"/>
</svg>
<span class="nhsuk-button__content">Previous</span>
</button>
Macro
Button warning
Code
Markup
<button class="nhsuk-button nhsuk-button--warning" data-module="nhsuk-button" type="submit">
<span class="nhsuk-u-visually-hidden">Warning: </span>Yes, delete this vaccine
</button>
Macro
Button warning as a link
Code
Markup
<a class="nhsuk-button nhsuk-button--warning" data-module="nhsuk-button" href="#" role="button" draggable="false">
<span class="nhsuk-u-visually-hidden">Warning: </span>Yes, delete this vaccine
</a>
Macro
Button warning as a link, small
Open this example in a new tab: Button warning as a link, small
Code
Markup
<a class="nhsuk-button nhsuk-button--warning nhsuk-button--small" data-module="nhsuk-button" href="#" role="button" draggable="false">
<span class="nhsuk-u-visually-hidden">Warning: </span>Yes, delete this vaccine
</a>
Macro
Button warning disabled
Code
Markup
<button class="nhsuk-button nhsuk-button--warning" data-module="nhsuk-button" type="submit" disabled aria-disabled="true">
<span class="nhsuk-u-visually-hidden">Warning: </span>Yes, delete this vaccine
</button>
Macro
Button warning disabled, small
Open this example in a new tab: Button warning disabled, small
Code
Markup
<button class="nhsuk-button nhsuk-button--warning nhsuk-button--small" data-module="nhsuk-button" type="submit" disabled aria-disabled="true">
<span class="nhsuk-u-visually-hidden">Warning: </span>Yes, delete this vaccine
</button>
Macro
Button warning class overriding variant option
Open this example in a new tab: Button warning class overriding variant option
Code
Markup
<button class="nhsuk-button nhsuk-button--warning" data-module="nhsuk-button" type="submit">
<span class="nhsuk-u-visually-hidden">Warning: </span>Continue
</button>
Macro
Button warning, small
Code
Markup
<button class="nhsuk-button nhsuk-button--warning nhsuk-button--small" data-module="nhsuk-button" type="submit">
<span class="nhsuk-u-visually-hidden">Warning: </span>Yes, delete this vaccine
</button>
Macro
Button warning with icon at end
Open this example in a new tab: Button warning with icon at end
Code
Markup
<button class="nhsuk-button nhsuk-button--warning nhsuk-button--icon" data-module="nhsuk-button" type="submit">
<span class="nhsuk-button__content"><span class="nhsuk-u-visually-hidden">Warning: </span>Next</span>
<svg class="nhsuk-icon nhsuk-icon--arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="m14.7 6.3 5 5c.2.2.3.4.3.7 0 .3-.1.5-.3.7l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3H5a1 1 0 0 1 0-2h11.6l-3.3-3.3a1 1 0 1 1 1.4-1.4Z"/>
</svg>
</button>
Macro
Button warning with icon at end, small
Open this example in a new tab: Button warning with icon at end, small
Code
Markup
<button class="nhsuk-button nhsuk-button--warning nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit">
<span class="nhsuk-button__content"><span class="nhsuk-u-visually-hidden">Warning: </span>Next</span>
<svg class="nhsuk-icon nhsuk-icon--arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="m14.7 6.3 5 5c.2.2.3.4.3.7 0 .3-.1.5-.3.7l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3H5a1 1 0 0 1 0-2h11.6l-3.3-3.3a1 1 0 1 1 1.4-1.4Z"/>
</svg>
</button>
Macro
Button warning with icon at start
Open this example in a new tab: Button warning with icon at start
Code
Markup
<button class="nhsuk-button nhsuk-button--warning nhsuk-button--icon" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M10.7 6.3c.4.4.4 1 0 1.4L7.4 11H19a1 1 0 0 1 0 2H7.4l3.3 3.3c.4.4.4 1 0 1.4a1 1 0 0 1-1.4 0l-5-5A1 1 0 0 1 4 12c0-.3.1-.5.3-.7l5-5a1 1 0 0 1 1.4 0Z"/>
</svg>
<span class="nhsuk-button__content"><span class="nhsuk-u-visually-hidden">Warning: </span>Previous</span>
</button>
Macro
Button warning with icon at start, small
Open this example in a new tab: Button warning with icon at start, small
Code
Markup
<button class="nhsuk-button nhsuk-button--warning nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M10.7 6.3c.4.4.4 1 0 1.4L7.4 11H19a1 1 0 0 1 0 2H7.4l3.3 3.3c.4.4.4 1 0 1.4a1 1 0 0 1-1.4 0l-5-5A1 1 0 0 1 4 12c0-.3.1-.5.3-.7l5-5a1 1 0 0 1 1.4 0Z"/>
</svg>
<span class="nhsuk-button__content"><span class="nhsuk-u-visually-hidden">Warning: </span>Previous</span>
</button>
Macro
Button with custom class
Code
Markup
<button class="nhsuk-link" data-module="nhsuk-button" type="submit">
Link as a button
</button>
Macro
Button with double click not prevented
Open this example in a new tab: Button with double click not prevented
Code
Markup
<button class="nhsuk-button" data-module="nhsuk-button" data-prevent-double-click="false" type="submit">
Save and continue
</button>
Macro
Button with double click prevented
Open this example in a new tab: Button with double click prevented
Code
Markup
<button class="nhsuk-button" data-module="nhsuk-button" data-prevent-double-click="true" type="submit">
Save and continue
</button>
Macro
Button with icon
Code
Markup
<button class="nhsuk-button nhsuk-button--icon" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--plus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M13.5 5.5a1.5 1.5 0 0 0-3 0v5h-5a1.5 1.5 0 0 0 0 3h5v5a1.5 1.5 0 0 0 3 0v-5h5a1.5 1.5 0 0 0 0-3h-5v-5Z"/>
</svg>
<span class="nhsuk-button__content">Increase</span>
</button>
Macro
Button with icon at end
Code
Markup
<button class="nhsuk-button nhsuk-button--icon" data-module="nhsuk-button" type="submit">
<span class="nhsuk-button__content">Next</span>
<svg class="nhsuk-icon nhsuk-icon--arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="m14.7 6.3 5 5c.2.2.3.4.3.7 0 .3-.1.5-.3.7l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3H5a1 1 0 0 1 0-2h11.6l-3.3-3.3a1 1 0 1 1 1.4-1.4Z"/>
</svg>
</button>
Macro
Button with icon at end, small
Open this example in a new tab: Button with icon at end, small
Code
Markup
<button class="nhsuk-button nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit">
<span class="nhsuk-button__content">Next</span>
<svg class="nhsuk-icon nhsuk-icon--arrow-right" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="m14.7 6.3 5 5c.2.2.3.4.3.7 0 .3-.1.5-.3.7l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3H5a1 1 0 0 1 0-2h11.6l-3.3-3.3a1 1 0 1 1 1.4-1.4Z"/>
</svg>
</button>
Macro
Button with icon at start
Code
Markup
<button class="nhsuk-button nhsuk-button--icon" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M10.7 6.3c.4.4.4 1 0 1.4L7.4 11H19a1 1 0 0 1 0 2H7.4l3.3 3.3c.4.4.4 1 0 1.4a1 1 0 0 1-1.4 0l-5-5A1 1 0 0 1 4 12c0-.3.1-.5.3-.7l5-5a1 1 0 0 1 1.4 0Z"/>
</svg>
<span class="nhsuk-button__content">Previous</span>
</button>
Macro
Button with icon at start, small
Open this example in a new tab: Button with icon at start, small
Code
Markup
<button class="nhsuk-button nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--arrow-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M10.7 6.3c.4.4.4 1 0 1.4L7.4 11H19a1 1 0 0 1 0 2H7.4l3.3 3.3c.4.4.4 1 0 1.4a1 1 0 0 1-1.4 0l-5-5A1 1 0 0 1 4 12c0-.3.1-.5.3-.7l5-5a1 1 0 0 1 1.4 0Z"/>
</svg>
<span class="nhsuk-button__content">Previous</span>
</button>
Macro
Button with icon HTML
Code
Markup
<button class="nhsuk-button nhsuk-button--icon" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--plus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M13.5 5.5a1.5 1.5 0 0 0-3 0v5h-5a1.5 1.5 0 0 0 0 3h5v5a1.5 1.5 0 0 0 3 0v-5h5a1.5 1.5 0 0 0 0-3h-5v-5Z"/>
</svg>
<span class="nhsuk-button__content">Increase</span>
</button>
Macro
Button with icon HTML only
Code
Markup
<button class="nhsuk-button nhsuk-button--icon" data-module="nhsuk-button" type="submit" aria-label="Increase">
<svg class="nhsuk-icon nhsuk-icon--plus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M13.5 5.5a1.5 1.5 0 0 0-3 0v5h-5a1.5 1.5 0 0 0 0 3h5v5a1.5 1.5 0 0 0 3 0v-5h5a1.5 1.5 0 0 0 0-3h-5v-5Z"/>
</svg>
</button>
Macro
Button with icon HTML only, small
Open this example in a new tab: Button with icon HTML only, small
Code
Markup
<button class="nhsuk-button nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit" aria-label="Increase">
<svg class="nhsuk-icon nhsuk-icon--plus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M13.5 5.5a1.5 1.5 0 0 0-3 0v5h-5a1.5 1.5 0 0 0 0 3h5v5a1.5 1.5 0 0 0 3 0v-5h5a1.5 1.5 0 0 0 0-3h-5v-5Z"/>
</svg>
</button>
Macro
Button with icon HTML, small
Open this example in a new tab: Button with icon HTML, small
Code
Markup
<button class="nhsuk-button nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--plus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M13.5 5.5a1.5 1.5 0 0 0-3 0v5h-5a1.5 1.5 0 0 0 0 3h5v5a1.5 1.5 0 0 0 3 0v-5h5a1.5 1.5 0 0 0 0-3h-5v-5Z"/>
</svg>
<span class="nhsuk-button__content">Increase</span>
</button>
Macro
Button with icon only
Code
Markup
<button class="nhsuk-button nhsuk-button--icon" data-module="nhsuk-button" type="submit" aria-label="Increase">
<svg class="nhsuk-icon nhsuk-icon--plus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M13.5 5.5a1.5 1.5 0 0 0-3 0v5h-5a1.5 1.5 0 0 0 0 3h5v5a1.5 1.5 0 0 0 3 0v-5h5a1.5 1.5 0 0 0 0-3h-5v-5Z"/>
</svg>
</button>
Macro
Button with icon only, small
Open this example in a new tab: Button with icon only, small
Code
Markup
<button class="nhsuk-button nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit" aria-label="Increase">
<svg class="nhsuk-icon nhsuk-icon--plus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M13.5 5.5a1.5 1.5 0 0 0-3 0v5h-5a1.5 1.5 0 0 0 0 3h5v5a1.5 1.5 0 0 0 3 0v-5h5a1.5 1.5 0 0 0 0-3h-5v-5Z"/>
</svg>
</button>
Macro
Button with icon, small
Code
Markup
<button class="nhsuk-button nhsuk-button--icon nhsuk-button--small" data-module="nhsuk-button" type="submit">
<svg class="nhsuk-icon nhsuk-icon--plus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" focusable="false" aria-hidden="true">
<path d="M13.5 5.5a1.5 1.5 0 0 0-3 0v5h-5a1.5 1.5 0 0 0 0 3h5v5a1.5 1.5 0 0 0 3 0v-5h5a1.5 1.5 0 0 0 0-3h-5v-5Z"/>
</svg>
<span class="nhsuk-button__content">Increase</span>
</button>
Macro
Button without class
Code
Markup
<button data-module="nhsuk-button" type="submit">
Default button
</button>
Macro
Button with small class
Code
Markup
<button class="nhsuk-button nhsuk-button--small" data-module="nhsuk-button" type="submit">
Save and continue
</button>
Macro
Button with small class overriding small option
Open this example in a new tab: Button with small class overriding small option
Code
Markup
<button class="nhsuk-button nhsuk-button--small" data-module="nhsuk-button" type="submit">
Save and continue
</button>
Macro
Button as a link
Code
Markup
<a class="nhsuk-button" data-module="nhsuk-button" href="#" role="button" draggable="false">
Link button
</a>
Macro
Button as a link opens in a new tab
Open this example in a new tab: Button as a link opens in a new tab
Code
Markup
<a class="nhsuk-button" data-module="nhsuk-button" href="#" rel="noopener noreferrer" target="_blank" role="button" draggable="false">
Link button
</a>
Macro
Button as a link opens in a new tab (with "rel" attribute)
Open this example in a new tab: Button as a link opens in a new tab (with "rel" attribute)
Code
Markup
<a class="nhsuk-button" data-module="nhsuk-button" href="#" target="_blank" role="button" draggable="false" rel="noopener">
Link button
</a>
Macro
Button as a link opens in a new tab (with "target" and "rel" attributes)
Code
Markup
<a class="nhsuk-button" data-module="nhsuk-button" href="#" role="button" draggable="false" target="_blank" rel="noopener">
Link button
</a>
Macro
Button as a link opens in a new tab (with "target" attribute)
Open this example in a new tab: Button as a link opens in a new tab (with "target" attribute)
Code
Markup
<a class="nhsuk-button" data-module="nhsuk-button" href="#" rel="noopener noreferrer" role="button" draggable="false" target="_blank">
Link button
</a>
Macro
Button as a link, small
Code
Markup
<a class="nhsuk-button nhsuk-button--small" data-module="nhsuk-button" href="#" role="button" draggable="false">
Link button
</a>