Skip to content

Commit 6a0cdae

Browse files
authored
docs(b-button): add accessibility section (bootstrap-vue#4770)
1 parent aedfedd commit 6a0cdae

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/components/button/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,16 @@ supported `<router-link>` related props.
257257

258258
Note the `<router-link>` prop `tag` is referred to as `router-tag` in `bootstrap-vue`.
259259

260+
## Accessibility
261+
262+
When the `href` prop is set to `'#'`, `<b-button>` will render a link (`<a>`) element with attribute
263+
`role="button"` set and apropriate keydown listeners (<kbd>Enter</kbd> and <kbd>Space</kbd>) so that
264+
the link acts like a native HTML `<button>` for screen reader and keyboard-only users. When disabled,
265+
the `aria-disabled="true"` attribute will be set on the `<a>` element.
266+
267+
When the `href` is set to any other value (or the `to` prop is used), `role="button"` will not be
268+
added, nor will the keyboad event listeners be enabled.
269+
260270
## See also
261271

262272
- [`<b-button-group>`](/docs/components/button-group)

0 commit comments

Comments
 (0)