What's new Report an issue
GIG Cymru NHS Wales, Digital Health and Care Wales

Buttons

Buttons let users take an action, such as submitting a form or confirming a patient. Pick the variant, size and framework; the preview and the code update together.

A button makes something happen. If it navigates somewhere instead, it is a link.


When to use

When not to use

Variants

VariantUse forPer view
PrimaryThe one action the screen exists forExactly one
SecondaryA supporting action alongside itAs needed
GhostCancel, back, tertiaryAs needed
DestructivePermanent deletionRare, always confirmed

How it works

Do & don't

DoDon't
"Confirm patient""OK", "Submit", "Yes"
One primary action per viewTwo primary buttons competing
Put cancel after the primary action in a formPut cancel first, where it is hit by muscle memory
Pair destructive actions with a confirmationDelete on a single click
Use a link for navigationStyle a link to look like a button and call it done
Explain why an action is unavailableDisable a button silently

Accessibility

Known gaps

lists a Warning variant that is not built, and describes an amber focus ring. The focus ring is Cyan/700 and has been since the focus-ring decision record. Treat this page and the code as current, and the spec as needing a rewrite.

For general button guidance such as grouping and ordering, follow GDS and NHS England.

Accessibility requirements

RequirementWCAG SCHow Single Record meets itTest method
Every button has a visible, descriptive label2.4.6 / 4.1.2Labels name the action and its subject, for example "Confirm patient" rather than "OK".Manual review, screen reader
Focus is clearly visible2.4.7A focus ring sits outside the element, paired with a 2px border so it reads on every surface.Keyboard tab, contrast check
Target size adequate2.5.8Default height is 40px; Small stays at or above 24×24px with spacing. Touch controls use 44px.Measure, touch device
Not colour alone1.4.1Destructive pairs red with an explicit label and a confirmation step.Greyscale review
Contrast1.4.3White on the primary interactive colour is 7.1:1, which passes AAA. Validated per variant.Automated contrast