#486·nue

markdown - buttons use the button role incorrectly

Author: evantCreated Feb 13, 2025Updated Oct 15, 2025
Labelsdocsnuemark

Describe the Bug

Reading the documentation on buttons and it says it generates the following html (also verified this is true)

xml
<a role="button" href="/docs/">Learn more</a>

This is not how the button role should be used. The general rule of thumb is that links navigate, buttons perform an action. This example navigates so it should be a link. This cause 2 problems:

  1. It misleads the user on what will happen if when they click it.
  2. It doesn't behavior properly without additional work. For example users expect buttons to active when you press space which this does not.

I think simply removing the role would be sufficient? Though you may want to rethink having buttons take an href option at all depending on what you want them to mean.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role https://www.washington.edu/accesstech/checklist/links-buttons/