From ce30cf9b38dfa2a7b4dec39c6620e0657a19f604 Mon Sep 17 00:00:00 2001 From: Dan Cormier Date: Wed, 24 Aug 2022 09:38:19 -0400 Subject: [PATCH] docs(button-group): document aria-current attribute usage (#1066) --- docs/product/components/button-groups.html | 49 ++++++++++++++++++---- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/docs/product/components/button-groups.html b/docs/product/components/button-groups.html index e183e438c7..a6700ccf88 100644 --- a/docs/product/components/button-groups.html +++ b/docs/product/components/button-groups.html @@ -2,7 +2,7 @@ layout: page title: Button groups figma: https://www.figma.com/file/9p5HuZwl9KXP9HpBZuvBoT/Button-Groups -description: Button groups are a collection of buttons. This component is used in our questions view, and is frequently used in conjunction with other form elements such as search fields and sorting dropdowns. If the content you’re interacting with is a simple paring down or filter of the current view, it’s appropriate to use the .s-btn-group component. Add the class .is-selected to show the currently-selected button. +description: Button groups are a collection of buttons. This component is used in our questions view, and is frequently used in conjunction with other form elements such as search fields and sorting dropdowns. If the content you’re interacting with is a simple paring down or filter of the current view, it’s appropriate to use the .s-btn-group component. Add the class .is-selected and the aria-current attribute with the appropriate value to show the currently selected button. ---
{% header "h2", "Classes" %} @@ -28,6 +28,33 @@
+ +{% header "h2", "Accessibility" %} +

+ When used as navigation or a filter, button groups should include the aria-label attribute with the appropriate value. +

+ +
+
+ + + + + + + + + + + + + + + +
ItemApplied toDescription
aria-current="[value]".s-btn.is-selectedWhen using a button group for navigation or filtering, include the aria-current attribute with the appropriate value to the selected button. Most commonly used values are page, step, and true.
+
+
+
{% header "h2", "Example" %}
@@ -36,7 +63,7 @@
- +
@@ -49,7 +76,7 @@ - +
@@ -80,7 +107,7 @@ 37 -
-