Buttons vs links
Buttons and links are not the same.
This button looks like a button.
This button looks like a link:
Fully disabled button
A button that uses the disabled attribute will not be focusable, but it is still discoverable by the screen reader while browsing.
Focusable disabled button
When a button isn’t ready to submit a form yet, but can still be clicked, use aria-disabled="true"
to increase perceivability for people using a screen reader. Ex: Clicks submit and is notified of errors in the form.
Avoid icon buttons
Buttons with no visible text (icon only) are inadvisable.
Use your words
You can think of words like a group of symbols that mean things.
Annotations for buttons
If it does something, it’s a <button>
- Buttons cause an action to occur on the same page
- Submit a form (even when submission takes you to a new page)
- Open a menu
- Launch a modal
- Expand details
- A button can look like a link, but it must be coded as a
<button>
If it goes somewhere, it’s <a>
link.
- Links take the browser to a different location
- (Either another page or even another area of the same page)
- A link can look like a big shiny button but it must be coded as
<a>
link
Repeating buttons
Sometimes a design will call for multiple buttons with the same text label. In a case like this, aria-label
can be used to name each control’s purpose.