Testing buttons

What to check when testing the accessibility of a button.

Test that the button is keyboard accessible

Notice what happens when you use keyboard commands to move between elements on the web page.

Check the following:

Test that the button’s name, role and states are programmatically determinable

Use tools — for example, browser developer tools — that show a component’s programmatically exposed accessibility details.

Test that the button has sufficient contrast

Use a tool that can test colour contrast.

Check the following:

Note: If the text in the button has a contrast ratio of at least 4.5:1 against surrounding colours, the border or background of the button does not need to meet contrast requirements. See Contrast of visual boundaries — Knowledge Area: Contrast for non-text content.