aboutsummaryrefslogtreecommitdiff
path: root/docs/components/button-group.md
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2017-04-21 23:36:24 -0700
committerMark Otto <[email protected]>2017-04-21 23:36:24 -0700
commit5463d8436b6404f5c647fb12e0cd0eafa4abf5e0 (patch)
treeada6f9b1f4990a182d829055ee079db9601dbf9b /docs/components/button-group.md
parent7efe4ddee499396efc40f53d1421b61fe5da328d (diff)
parent638b97f19c4df6f51475f8088555e3eefd2b986f (diff)
downloadbootstrap-5463d8436b6404f5c647fb12e0cd0eafa4abf5e0.tar.xz
bootstrap-5463d8436b6404f5c647fb12e0cd0eafa4abf5e0.zip
Merge branch 'v4-dev' into form-tweaks
Diffstat (limited to 'docs/components/button-group.md')
-rw-r--r--docs/components/button-group.md12
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/components/button-group.md b/docs/components/button-group.md
index 59a18e262..d2d5140ed 100644
--- a/docs/components/button-group.md
+++ b/docs/components/button-group.md
@@ -12,6 +12,14 @@ Group a series of buttons together on a single line with the button group. Add o
* Will be replaced with the ToC, excluding the "Contents" header
{:toc}
+{% callout warning %}
+## Ensure correct `role` and provide a label
+
+In order for assistive technologies (such as screen readers) to convey that a series of buttons is grouped, an appropriate `role` attribute needs to be provided. For button groups, this would be `role="group"`, while toolbars should have a `role="toolbar"`.
+
+In addition, groups and toolbars should be given an explicit label, as most assistive technologies will otherwise not announce them, despite the presence of the correct role attribute. In the examples provided here, we use `aria-label`, but alternatives such as `aria-labelledby` can also be used.
+{% endcallout %}
+
## Basic example
Wrap a series of buttons with `.btn` in `.btn-group`.
@@ -59,7 +67,7 @@ Feel free to mix input groups with button groups in your toolbars. Similar to th
</div>
<div class="input-group">
<span class="input-group-addon" id="btnGroupAddon">@</span>
- <input type="text" class="form-control" placeholder="Input group example" aria-describedby="btnGroupAddon">
+ <input type="text" class="form-control" placeholder="Input group example" aria-label="Input group example" aria-describedby="btnGroupAddon">
</div>
</div>
@@ -72,7 +80,7 @@ Feel free to mix input groups with button groups in your toolbars. Similar to th
</div>
<div class="input-group">
<span class="input-group-addon" id="btnGroupAddon2">@</span>
- <input type="text" class="form-control" placeholder="Input group example" aria-describedby="btnGroupAddon2">
+ <input type="text" class="form-control" placeholder="Input group example" aria-label="Input group example" aria-describedby="btnGroupAddon2">
</div>
</div>
{% endexample %}