summaryrefslogtreecommitdiffstats
path: root/site/content/docs/5.3/components/button-group.md
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--site/content/docs/5.3/components/button-group.md (renamed from site/content/docs/5.2/components/button-group.md)38
1 files changed, 17 insertions, 21 deletions
diff --git a/site/content/docs/5.2/components/button-group.md b/site/content/docs/5.3/components/button-group.md
index 8f7d2d6..9c63562 100644
--- a/site/content/docs/5.2/components/button-group.md
+++ b/site/content/docs/5.3/components/button-group.md
@@ -18,12 +18,8 @@ Wrap a series of buttons with `.btn` in `.btn-group`.
</div>
{{< /example >}}
-{{< 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.
+{{< callout info >}}
+Button groups require an appropriate `role` attribute and explicit label to ensure assistive technologies like screen readers identify buttons as grouped and announce them. Use `role="group"` for button groups or `role="toolbar"` for button toolbars. Then use `aria-label` or `aria-labelledby` to label them.
{{< /callout >}}
These classes can also be added to groups of links, as an alternative to the [`.nav` navigation components]({{< docsref "/components/navs-tabs" >}}).
@@ -145,21 +141,21 @@ Instead of applying button sizing classes to every button in a group, just add `
{{< example >}}
<div class="btn-group btn-group-lg" role="group" aria-label="Large button group">
- <button type="button" class="btn btn-outline-dark">Left</button>
- <button type="button" class="btn btn-outline-dark">Middle</button>
- <button type="button" class="btn btn-outline-dark">Right</button>
+ <button type="button" class="btn btn-outline-primary">Left</button>
+ <button type="button" class="btn btn-outline-primary">Middle</button>
+ <button type="button" class="btn btn-outline-primary">Right</button>
</div>
<br>
<div class="btn-group" role="group" aria-label="Default button group">
- <button type="button" class="btn btn-outline-dark">Left</button>
- <button type="button" class="btn btn-outline-dark">Middle</button>
- <button type="button" class="btn btn-outline-dark">Right</button>
+ <button type="button" class="btn btn-outline-primary">Left</button>
+ <button type="button" class="btn btn-outline-primary">Middle</button>
+ <button type="button" class="btn btn-outline-primary">Right</button>
</div>
<br>
<div class="btn-group btn-group-sm" role="group" aria-label="Small button group">
- <button type="button" class="btn btn-outline-dark">Left</button>
- <button type="button" class="btn btn-outline-dark">Middle</button>
- <button type="button" class="btn btn-outline-dark">Right</button>
+ <button type="button" class="btn btn-outline-primary">Left</button>
+ <button type="button" class="btn btn-outline-primary">Middle</button>
+ <button type="button" class="btn btn-outline-primary">Right</button>
</div>
{{< /example >}}
@@ -190,12 +186,12 @@ Make a set of buttons appear vertically stacked rather than horizontally. **Spli
{{< example >}}
<div class="btn-group-vertical" role="group" aria-label="Vertical button group">
- <button type="button" class="btn btn-dark">Button</button>
- <button type="button" class="btn btn-dark">Button</button>
- <button type="button" class="btn btn-dark">Button</button>
- <button type="button" class="btn btn-dark">Button</button>
- <button type="button" class="btn btn-dark">Button</button>
- <button type="button" class="btn btn-dark">Button</button>
+ <button type="button" class="btn btn-primary">Button</button>
+ <button type="button" class="btn btn-primary">Button</button>
+ <button type="button" class="btn btn-primary">Button</button>
+ <button type="button" class="btn btn-primary">Button</button>
+ <button type="button" class="btn btn-primary">Button</button>
+ <button type="button" class="btn btn-primary">Button</button>
</div>
{{< /example >}}