Accessible Buttons: How to Design Buttons According to WCAG
Buttons without an accessible name, without keyboard support or with targets that are too small are among the most common barriers on the web. This guide shows which WCAG criteria apply to buttons and how to meet them step by step.
Summary
Accessible buttons use the native button element, have an accessible name, can be operated with Enter and Space, show a visible focus, meet the required contrast ratios and are at least 24 × 24 CSS pixels in size under WCAG 2.2.
Accessible Buttons: How to Design Buttons According to WCAG
Buttons are among the most common barriers on the web. According to the WebAIM Million 2026, 30.6% of the home pages analyzed have at least one button without an accessible name. For people using a screen reader, a keyboard or voice control, such a button is unusable. This guide shows which WCAG 2.2 criteria apply to buttons and how to meet them in seven steps.
Why buttons so often become barriers
Most problems are not caused by a lack of knowledge but by shortcuts in design and development: an icon without text becomes a button, a div gets a click handler, the focus outline is removed for visual reasons, or the button is too small on a smartphone. Visually, this works. Technically, however, the name, role or keyboard support that assistive technologies need is missing. You can find more typical errors in our overview of common barriers and solutions.
The WCAG criteria that apply to buttons
The following success criteria are particularly relevant for buttons. How the criteria are structured overall is explained in our overview of WCAG criteria.
- 2.1.1 Keyboard (A): Every button can be operated without a mouse.
- 4.1.2 Name, Role, Value (A): Assistive technologies recognize that it is a button, what it is called and what state it is in.
- 2.5.3 Label in Name (A): The accessible name contains the visible text of the button.
- 2.4.7 Focus Visible (AA): The keyboard focus is visible.
- 2.4.11 Focus Not Obscured, Minimum (AA, new in WCAG 2.2): A focused button is not entirely hidden by other content such as a sticky header.
- 1.4.3 Contrast, Minimum (AA): Button text reaches 4.5:1, large text 3:1.
- 1.4.11 Non-text Contrast (AA): Whatever is needed to identify the button and its state reaches 3:1 against adjacent colors.
- 2.5.8 Target Size, Minimum (AA, new in WCAG 2.2): The target is at least 24 × 24 CSS pixels or has sufficient spacing.
The right element: button instead of div
Always use the native button element for actions. It already comes with role, focusability and keyboard support. A div or span with a click handler has to rebuild all of this and often fails in practice. The rule of thumb: if the element takes users to another page, it is a link. If it triggers an action on the page, it is a button.
<!-- Not accessible -->
<div class="btn" onclick="save()">Save</div>
<!-- Accessible -->
<button type="button" onclick="save()">Save</button>
An accessible name for every button
Every button needs a name that screen readers can announce. For buttons with visible text, that text is the name. For icon-only buttons such as a magnifier, cart or close icon, the name is missing. In that case, add an aria-label or visually hidden text. Important for voice control: if the button visibly says "Send", the accessible name must contain this word too, so that the command "Click Send" works.
<button type="button" aria-label="Close menu">
<svg aria-hidden="true" focusable="false">…</svg>
</button>
Operable by keyboard
A button must be reachable with the Tab key and triggered with Enter and the Space bar. The native button element does both without additional code. If your team rebuilds a button from another element, it needs role="button", tabindex="0" and its own keyboard handlers for both keys. Learn more about the basics in our lexicon entry on keyboard accessibility.
A visible focus that is not obscured
Never remove the focus outline with outline: none without a replacement. Keyboard users must always be able to see which button is currently active. A clearly visible focus stands out from the background, for example with a strong outline offset from the button. Also check whether fixed elements such as sticky headers, cookie banners or chat windows completely cover a focused button. Since WCAG 2.2, this is a separate Level AA criterion.
button:focus-visible {
outline: 3px solid #1d4ed8;
outline-offset: 2px;
}
Contrast for text, borders and states
Button text needs a contrast ratio of at least 4.5:1 against its background, or 3:1 for large text. In addition, non-text contrast of 3:1 applies to the button itself: if a button can only be identified by its background color or border, that area must reach 3:1 against adjacent colors. The same applies to states such as focus or selected. Disabled buttons are exempt from the contrast requirements. You can quickly check your color combinations with the Contrast Checker.
Target size: at least 24 × 24 pixels
At Level AA, WCAG 2.2 requires a target size of at least 24 × 24 CSS pixels. Smaller buttons are allowed if they are spaced far enough apart: a circle with a 24-pixel diameter centered on each button must not intersect another button or another such circle. Exceptions include links within running text and controls whose size is determined by the browser. For Level AAA, WCAG specifies 44 × 44 CSS pixels. Everyone using a smartphone benefits, especially people with motor impairments.
Communicate states correctly
Buttons that toggle something communicate their state: a toggle button such as "Mute" gets aria-pressed="true" or "false", while its label stays the same. A button that expands a menu or section uses aria-expanded. For disabled buttons: the disabled attribute removes the button from the tab order. If it should remain reachable, for example so users can read a hint, use aria-disabled="true" instead and prevent the action with a script.
<button type="button" aria-pressed="false">Mute</button>
<button type="button" aria-expanded="false" aria-controls="menu">Menu</button>
Does this also apply under the BFSG?
For websites, the German Accessibility Strengthening Act (BFSG) refers to the harmonized standard EN 301 549. Its version V3.2.1 adopts the requirements of WCAG 2.1 at Level AA. Apart from Focus Not Obscured (2.4.11) and Target Size (2.5.8), which are new in WCAG 2.2, all criteria mentioned here are therefore already part of the requirements. Since September 2026, EN 301 549 V4.1.1 has been available as a version based on WCAG 2.2. Its listing in the Official Journal of the EU is decisive for the legal presumption of conformity. If you build new components, it is best to implement both criteria right away.
SiteCockpit Solution
Check buttons automatically
With easyMonitoring, you automatically find buttons without an accessible name and other WCAG violations on all monitored pages, including the location and a fix recommendation. Aspects that cannot be measured reliably by automated tests, such as a visible focus or a logical tab order, can be checked with the guided manual checks.
Discover easyMonitoring →Frequently asked questions about accessible buttons
How large does an accessible button need to be?
Under WCAG 2.2, success criterion 2.5.8 (Level AA), at least 24 × 24 CSS pixels. Smaller buttons are allowed if there is enough spacing to other controls. Level AAA calls for 44 × 44 CSS pixels.
Is a div with a click handler enough as a button?
Only with considerable extra work: it needs role="button", tabindex="0" and its own keyboard handlers for Enter and Space. The native button element provides all of this out of the box and is therefore the better choice.
What contrast do buttons need?
Button text needs at least 4.5:1, large text 3:1. If the button can only be identified by its fill or border, that visual must reach 3:1 against adjacent colors. Disabled buttons are exempt.
How do I name a button that only shows an icon?
With an aria-label such as "Open search" or visually hidden text inside the button. The icon itself is hidden from screen readers with aria-hidden="true".
Test your website now
How accessible are the buttons on your website? Check it now for free with the SiteCockpit Livecheck.
Test for free nowRead more – WCAG & Technology
Accessible CAPTCHA: Alternatives to Image Puzzles in Shops
Screen reader users rank CAPTCHAs as their biggest problem: protect forms from bots without locking customers out.
Building Accessible Forms: A Guide for Online Shops
Labels, required fields, error messages, checkout: how to build accessible forms in your online shop under WCAG 2.2.
WCAG 3.0: What Businesses Should Prepare For Now
WCAG 3.0 is still in the works, WCAG 2.2 stays legally binding. What changes and what to do now.