From 9fa56a6bfddd2c916ed433e3229b9780beceeb9b Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Wed, 12 Jul 2017 23:50:28 +0100 Subject: [PATCH] Add badge counter example and accessibility advice --- docs/4.0/components/badge.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/4.0/components/badge.md b/docs/4.0/components/badge.md index e2d92b08b3a0..4e80828a440b 100644 --- a/docs/4.0/components/badge.md +++ b/docs/4.0/components/badge.md @@ -28,6 +28,36 @@ Badges scale to match the size of the immediate parent element by using relative
Example heading New
{% endhighlight %} +Badges can be used as part of links or buttons to provide a counter. + +
+ +
+ +{% highlight html %} + +{% endhighlight %} + +Note that depending on how they are used, badges may be confusing for users of screen readers and similar assistive technologies. While the styling of badges provides a visual cue as to their purpose, these users will simply be presented with the content of the badge. Depending on the specific situation, these badges may seem like random additional words or numbers at the end of a sentence, link or button. Unless the context is clear (as with the "Notifications" example, where it is arguably understandable that the "4" gives a count of the number of notifications), consider including additional context – for instance using a visually hidden piece of additional text. + +
+ +
+ +{% highlight html %} + +{% endhighlight %} + ## Contextual variations Add any of the below mentioned modifier classes to change the appearance of a badge.