Must haves
- Use links for navigating to a new page.
- Use buttons for taking an action on the current page.
- Use semantic html, i.e.,
<button>
or<a href="...">
. You get accessibility features for free with these, including keyboard access and the correct role being communicated to assistive technology.- If you need to go custom, make it keyboard accessible by adding
tabindex="0"
and apply the correct ARIA role, i.e.,role="link"
orrole="button"
. Ensure buttons respond to both Enter and Spacebar keys.
- If you need to go custom, make it keyboard accessible by adding
- Ensure each link and button has text that is unique on the page (ex: “Read more” occurring 10 times on the page is not unique.)
- Ensure when you tab to links and buttons, there is a clear visible focus indicator. Leave the default outline state of all browsers intact, and avoid adjusting the CSS style for focus state.
- Ideally, your design system includes different visual styles for buttons that require more or less prominence, for example, in the example above for the Timeout Modal, the primary button is displayed with a solid teal style, while the secondary button is displayed with white button and teal outline. This helps the user’s eyes discern between the two interaction options.
Learn more about accessible links [Google Doc]
Visual example
Default | Hover / Focus | Disabled |
---|---|---|
![]() | ![]() | ![]() |
Do and Don't
Do | Don't |
---|---|
Best, native semantic HTML elements:
Second best, add ARIA roles and keyboard access:</p>
|
These are neither keyboard accessible, nor do they communicate any role to assistive technology to indicate that they are interactive and what they might do. |