Skip to content

Commit c0ea771

Browse files
committed
update/badge_count
1 parent 7a96916 commit c0ea771

File tree

3 files changed

+175
-61
lines changed

3 files changed

+175
-61
lines changed

components/indicator/badge/badge_count/badge_count.md

Lines changed: 128 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,129 @@
22

33
## Intro 👈🤖
44

5-
A badge count is a non-interactive visual indicator that displays numeric values to communicate quantities or notification counts.
5+
Badge Count is a compact numerical indicator that displays quantities like unread notifications, item counts, or pending actions on interface elements.
66

77
---
88

99
## Definition
1010

11-
🚧 Missing from source: Definition section in badge_count_overview.md
11+
The Badge is a small UI element used to highlight status, notifications, or categorization within an interface. It is often displayed as a label or indicator with a distinct background color and text.
12+
13+
**Usage:**
14+
• Display numerical values (e.g., unread messages, notifications).
1215

1316
---
1417

1518
## Best for 👈🤔
1619

17-
✅ Displaying unread notification counts on navigation icons or menu items
20+
✅ Displaying unread message or notification counts on navigation icons
1821

19-
✅ Showing the number of items in a shopping cart or basket
22+
✅ Showing item quantities in shopping carts or baskets
2023

21-
✅ Indicating active filter counts in search or data table interfaces
24+
✅ Indicating pending tasks or action items requiring attention
2225

23-
✅ Communicating pending task or action quantities requiring user attention
26+
✅ Communicating status counts on tabs or navigation items
2427

25-
Displaying unread message counts in messaging or email applications
28+
Highlighting new content arrivals in feeds or inboxes
2629

27-
Showing the number of updates or alerts in system status indicators
30+
Representing active filter counts in data tables
2831

29-
Indicating quantities in tabbed interfaces where counts provide useful context
32+
Showing selected item quantities in multi-select interfaces
3033

31-
Communicating real-time count changes for collaborative or dynamic content
34+
Displaying error or warning counts in system dashboards
3235

33-
Displaying error or warning counts that need user acknowledgment
36+
Indicating unprocessed queue items in workflow interfaces
3437

35-
Showing selection counts in multi-select or batch operation interfaces
38+
Communicating real-time count changes in collaborative tools
3639

3740
---
3841

3942
## Anatomy 👈🤖
4043

4144
| # | Element | Purpose | Optional |
4245
|---|---------|---------|----------|
43-
| 1 | Container | Pill-shaped background that holds the count value and provides visual emphasis through status color | N |
44-
| 2 | Count label | Numeric text displaying the quantity value, centered within the container | N |
45-
| 3 | Status color | Background color indicating semantic meaning: Neutral, Accent, Positive, Info, Warning, or Negative | N |
46-
| 4 | Padding | Horizontal spacing ensuring consistent internal layout regardless of digit count | N |
47-
| 5 | Border radius | Pill shape (2000px radius) creating the characteristic rounded appearance | N |
46+
| 1 | Container | Pill-shaped background that holds the count value and provides visual emphasis through status-specific colors | N |
47+
| 2 | Count text | Numeric value displayed within the container indicating quantity or amount | N |
48+
| 3 | Status color | Background color that conveys semantic meaning (neutral, accent, positive, info, warning, negative) | N |
49+
| 4 | Typography | Label font styling applied to the count text for readability at small sizes | N |
50+
| 5 | Padding | Horizontal spacing within the container that ensures count text has adequate breathing room | N |
51+
| 6 | Minimum width | Constraint ensuring the badge maintains a circular shape for single-digit counts | N |
4852

4953
---
5054

51-
🚧 Missing from source: badge_count_overview.md file required (no additional sections found to inject)
55+
## Status
56+
57+
Badges have seven states depending on the context of the information they represent. Each state is designed to convey a specific meaning and ensure clarity in communication.
58+
59+
**`Neutral`** Used for general labels without specific emphasis.
60+
61+
**`Accent`** Employed to highlight discovery or exploration-related content.
62+
63+
**`Positive`** Indicates success, completion, or approval.
64+
65+
**`Info`** Provides informational context without urgency.
66+
67+
**`Warning`** Negatives the user to potential risks or cautionary messages.
68+
69+
**`Negative`** Draws attention to important or critical information.
70+
Often used for errors, restrictions, or urgent messages, but not exclusively for failures.
5271

5372
---
5473

55-
# Specs
74+
## status_do_&_dont 👈🤔
5675

57-
## States
76+
**Do:** Use semantic status colors consistently throughout the application to establish clear visual language for users
77+
**Don't:** Use red/negative status for non-critical information, as it creates unnecessary alarm and diminishes urgency perception
5878

59-
🚧 Missing from source: States section in badge_count_overview.md
79+
**Do:** Reserve the Accent status for highlighting promotional or discovery-related counts that encourage exploration
80+
**Don't:** Mix status meanings across contexts—a color should always represent the same semantic meaning
6081

61-
Based on Figma component data, the Badge Count supports the following states:
82+
**Do:** Use Neutral status as the default when the count doesn't require semantic emphasis or urgency
83+
**Don't:** Overuse Warning or Negative statuses, as they lose impact when applied to non-urgent information
6284

63-
**Enabled state**: The badge displays with full status color styling and readable count text. The contrast ratio between content and background meets the 4.5:1 minimum requirement.
85+
**Do:** Apply Positive status to communicate successful completions, approvals, or beneficial counts
86+
**Don't:** Use multiple different status colors in close proximity without clear contextual differentiation
6487

65-
**Disabled state**: The badge displays with a muted background color (`color-action-disabled`) and reduced contrast text (`color-content-on-action-disabled`), indicating the associated element or feature is unavailable.
88+
**Do:** Consider colorblind users by ensuring status meaning is conveyed through context, not color alone
89+
**Don't:** Rely solely on status color to communicate critical information—pair with labels or icons when essential
90+
91+
---
92+
93+
## Size
94+
95+
**`Medium`** The default size, providing a balance between visibility and space efficiency, suitable for most use cases.
96+
97+
**`Large`** A prominent badge for drawing more attention, often used in dashboards or highlighted sections.
98+
99+
---
100+
101+
## size_do_&_dont 👈🤔
102+
103+
**Do:** Use Medium size (16px) as the default for most interface contexts where badges appear alongside icons or text
104+
**Don't:** Use Large size in compact layouts where it may crowd adjacent elements or disrupt visual hierarchy
105+
106+
**Do:** Choose Large size (20px) for dashboards, cards, or areas where the count requires prominent visibility
107+
**Don't:** Mix badge sizes inconsistently within the same component or navigation pattern
108+
109+
**Do:** Ensure badge size is proportional to the parent element it's associated with (icons, buttons, avatars)
110+
**Don't:** Use badges so small they become illegible or difficult to distinguish from decorative dots
111+
112+
**Do:** Consider touch target requirements when badges are placed on interactive elements in mobile contexts
113+
**Don't:** Increase badge size solely to draw attention—use status colors or positioning instead
114+
115+
**Do:** Maintain consistent size selection across similar use cases throughout the application
116+
**Don't:** Choose Large size for single-digit counts where Medium provides sufficient visibility
117+
118+
---
119+
120+
# Specs
121+
122+
## States
123+
124+
**`Enabled`** The active state of a badge. Includes all possible visual statuses that represent the current state of the system or element (e.g., success, warning, error, information, etc.). Used when the badge should attract attention and convey meaningful information.
125+
126+
**`Disabled`** The inactive state of a badge. Used to indicate that the user isn't allowed to interact with an element, or when the status is unavailable. It appears less prominent and serves as a secondary indication.
127+
Badges with content keep the Enabled content but change their visual appearance.
66128

67129
---
68130

@@ -76,81 +138,89 @@ Based on Figma component data, the Badge Count supports the following states:
76138

77139
## Accessibility intro
78140

79-
Badge Count components must meet WCAG 2.2 Level AA standards for color contrast, status communication, and assistive technology compatibility. For comprehensive accessibility guidance, see the [Orange Unified Design System Accessibility Overview](https://unified-design-system.orange.com/472794e18/p/88ebab-accessibility-and-sustainability).
141+
Badge Count components must meet WCAG 2.2 Level AA requirements for color contrast, non-text content identification, and status message communication. For comprehensive accessibility guidance, see the [Orange Unified Design System Accessibility Overview](https://unified-design-system.orange.com/472794e18/p/88ebab-accessibility-and-sustainability).
80142

81143
---
82144

83145
## Accessibility Challenges
84146

85-
Badge counts present unique accessibility challenges because they are non-interactive visual indicators that communicate dynamic numeric information. Users must be able to perceive badge updates through multiple channels, and screen reader users need equivalent access to count changes without requiring focus navigation to the badge element.
147+
Badge counts present unique accessibility challenges because they convey dynamic numerical information through small visual indicators that must be perceivable by all users regardless of ability. The compact size, reliance on color for status meaning, and non-interactive nature require careful implementation to ensure screen reader users receive equivalent information.
86148

87149
### Key Challenges
88-
- Color-only status differentiation may exclude users with color vision deficiencies
89-
- Dynamic count updates may not be announced to screen reader users
90-
- Small text size within badges can impact readability for users with low vision
91-
- Non-interactive nature means standard focus-based announcement patterns don't apply
150+
151+
- Small size makes meeting 4.5:1 contrast ratio critical for text legibility
152+
- Status colors must not be the sole method of conveying semantic meaning
153+
- Dynamic count updates need to be announced to assistive technology users
154+
- Non-interactive nature means badges should not receive keyboard focus
92155

93156
### Critical Success Factors
157+
94158
1. Maintain 4.5:1 minimum contrast ratio between count text and background (WCAG 1.4.3)
95-
2. Provide programmatic context through `aria-label` or adjacent text for screen readers
96-
3. Use ARIA live regions to announce count changes when updates occur dynamically
97-
4. Ensure status meaning is conveyed through more than color alone
159+
2. Provide programmatic text alternatives via `aria-label` or visually hidden text
160+
3. Use `aria-live` regions for dynamic count updates when contextually important
161+
4. Ensure status meaning is conveyed through context, not color alone
98162

99163
---
100164

101165
## Design Requirements
102166

103167
### Structure & Labels
104-
- [ ] **Accessible context**: Provide descriptive text via `aria-label` or visually hidden text (e.g., "5 unread messages" not just "5") ([Orange labeling guidelines](https://a11y-guidelines.orange.com/en/web/develop/textual-content/))
105-
- [ ] **Non-interactive element**: Badge should not receive keyboard focus as it is purely informational (WCAG 2.4.3)
106-
- [ ] **Semantic association**: Position badge adjacent to its related element so context is clear to all users
168+
169+
- [ ] **Accessible name**: Provide descriptive `aria-label` (e.g., "5 unread notifications") conveying count purpose ([Orange A11y - Accessible Name](https://a11y-guidelines.orange.com/en/web/develop/textual-content/))
170+
- [ ] **Hidden text alternative**: Include visually hidden text for screen readers when badge is purely visual
171+
- [ ] **Contextual association**: Ensure badge is programmatically associated with its parent element via proximity or `aria-describedby`
107172

108173
### Visual Design
109-
- [ ] **Text contrast**: Minimum 4.5:1 contrast ratio between count and background color ([Orange contrast guidelines](https://a11y-guidelines.orange.com/en/web/design/colors-and-contrasts/))
110-
- [ ] **Color independence**: Don't rely solely on color to convey status; combine with text labels or icons when critical
111-
- [ ] **Minimum size**: Ensure count text meets minimum 12px font size for readability
174+
175+
- [ ] **Color contrast**: Minimum 4.5:1 ratio between count text and background color ([Orange A11y - Colors](https://a11y-guidelines.orange.com/en/web/design/colors-and-contrasts/))
176+
- [ ] **Non-color identification**: Status meaning conveyed through context/labels, not color alone
177+
- [ ] **Minimum size**: Ensure count text meets minimum target size for legibility
112178

113179
### Content
114-
- [ ] **Meaningful counts**: ❌ "5" / ✅ "5 notifications" (via accessible label) ([Orange content guidelines](https://a11y-guidelines.orange.com/en/web/develop/textual-content/))
115-
- [ ] **Truncation clarity**: Use "99+" pattern for large numbers with accessible full count available
180+
181+
- [ ] **Meaningful counts**: ❌ "99+" without context / ✅ "99+ unread messages" with full context available
182+
- [ ] **Truncation handling**: Provide full count value to assistive technology when visually truncated
116183

117184
---
118185

119186
## Testing Checklist
120187

121188
### Screen Reader Testing
189+
122190
- [ ] Test with NVDA (Windows), JAWS (Windows), VoiceOver (macOS/iOS), TalkBack (Android)
123-
- [ ] Verify badge context announced correctly, count values read accurately, status meaning communicated
191+
- [ ] Verify badge count and purpose are announced, status context communicated, dynamic updates spoken
124192

125193
### Keyboard Testing
126-
- [ ] Confirm badge does not receive focus (non-interactive)
127-
- [ ] Verify associated interactive element (icon, button) is keyboard accessible and announces badge context
128194

129-
### Live Region Testing
130-
- [ ] Verify count changes announced via `aria-live="polite"` when updates occur dynamically
131-
- [ ] Confirm announcements don't interrupt critical user tasks
195+
- [ ] Confirm badge does not receive focus (non-interactive element)
196+
- [ ] Verify parent interactive element announces badge information when focused
197+
198+
### Dynamic Updates Testing
199+
200+
- [ ] Verify `aria-live="polite"` announces count changes without interrupting user tasks
201+
- [ ] Test that screen readers announce meaningful updates (e.g., "3 new notifications")
132202

133203
Resources: [Orange Accessibility Testing Guide](https://a11y-guidelines.orange.com/en/web/test/)
134204

135205
---
136206

137207
## Key WCAG Criteria
138208

139-
- **1.4.3 Contrast (Minimum)** (AA): Count text must have 4.5:1 contrast ratio against badge background
140-
- **1.4.1 Use of Color** (A): Status information conveyed by color must also be available through text or context
141-
- **4.1.3 Status Messages** (AA): Dynamic count updates must be programmatically announced without receiving focus
142-
- **1.1.1 Non-text Content** (A): Provide accessible name describing the badge's purpose and count context
143-
- **2.4.3 Focus Order** (A): Badge should not appear in keyboard focus sequence as non-interactive element
209+
- **1.1.1 Non-text Content** (A): Badge count has text alternative accessible to assistive technology
210+
- **1.4.1 Use of Color** (A): Status meaning not conveyed by color alone—context provides meaning
211+
- **1.4.3 Contrast (Minimum)** (AA): Count text has 4.5:1 contrast ratio against badge background
212+
- **4.1.2 Name, Role, Value** (A): Badge has accessible name describing count and purpose
213+
- **4.1.3 Status Messages** (AA): Dynamic count updates announced via `aria-live` without focus change
144214

145-
For complete reference: [Orange Accessibility Guidelines - Component Examples](https://a11y-guidelines.orange.com/en/web/components-examples/)
215+
For complete reference: [Orange Accessibility Guidelines - Web Components](https://a11y-guidelines.orange.com/en/web/components-examples/)
146216

147217
---
148218

149219
## Additional Resources
150220

221+
- [Orange Accessibility Guidelines - Textual Content](https://a11y-guidelines.orange.com/en/web/develop/textual-content/)
151222
- [Orange Accessibility Guidelines - Colors and Contrasts](https://a11y-guidelines.orange.com/en/web/design/colors-and-contrasts/)
152-
- [WCAG 2.2 Understanding Status Messages (4.1.3)](https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html)
153-
- [W3C ARIA Live Regions](https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA19)
223+
- [W3C WAI - ARIA Live Regions](https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA19)
154224
- [Orange Design System - Accessibility & Sustainability](https://unified-design-system.orange.com/472794e18/p/88ebab-accessibility-and-sustainability)
155225

156226
---
@@ -159,6 +229,6 @@ For complete reference: [Orange Accessibility Guidelines - Component Examples](h
159229

160230
| Date | Number | Notes | Designer |
161231
|------|--------|-------|----------|
162-
| Oct 14, 2025 | 1.2.0 | The component now has two states: Enabled and Disabled. Documentation has been updated and published in Zeroeight, with use case examples provided for every state. The colors and background tokens for the functional states of the positive and info statuses have been changed. The minimum required contrast ratio has been corrected from 3:1 to 4.5:1 between content (count) and background for Enable state. For the "Status neutral" variant: The content token "color-content-on-status-neutral-emphasized" has been replaced by the token "color-content-inverse" The surface token "color-surface-status-neutral-emphasized" has been replaced by the token "color-surface-inverse-high" | Anton Astafev |
163-
| Jun 16, 2025 | 1.1.0 | "Accent" variant added | Maxime Tonnerre |
164-
| Mai 9, 2025 | 1.0.0 | Component creation | Anton Astafev |
232+
| Oct 14, 2025 | 1.2.0 | <ul><li>The component now has two states: Enabled and Disabled. <li>Documentation has been updated and published in Zeroeight, with use case examples provided for every state. <li>The colors and background tokens for the functional states of the positive and info statuses have been changed. <li>The minimum required contrast ratio has been corrected from 3:1 to 4.5:1 between content (count) and background for Enable state.</ul>For the "Status neutral" variant: <ul><li>The content token "color-content-on-status-neutral-emphasized" has been replaced by the token "color-content-inverse" <li>The surface token "color-surface-status-neutral-emphasized" has been replaced by the token "color-surface-inverse-high"</ul> | Anton Astafev |
233+
| Jun 16, 2025 | 1.1.0 | <ul><li>"Accent" variant added</ul> | Maxime Tonnerre |
234+
| Mai 9, 2025 | 1.0.0 | <ul><li>Component creation</ul> | Anton Astafev |

0 commit comments

Comments
 (0)