aboutsummaryrefslogtreecommitdiff
path: root/docs/components/button-group.md
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2017-05-27 15:26:48 -0700
committerMark Otto <[email protected]>2017-05-27 15:26:48 -0700
commit8f67ac19a761b8d3ecc80485c3f54aa6ba4fa910 (patch)
treed5a2aba4e2e762b283e7cfe60f00e1f239105bbe /docs/components/button-group.md
parent6c3f833076a9fa68601741e3e21bd07ad79b7d8a (diff)
parentdb44e4b311317ef760f8412cc33c84146959b248 (diff)
downloadbootstrap-8f67ac19a761b8d3ecc80485c3f54aa6ba4fa910.tar.xz
bootstrap-8f67ac19a761b8d3ecc80485c3f54aa6ba4fa910.zip
Merge branch 'v4-dev' into v4-docs-streamlined
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 %}