Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

### Documentation

- Clarify that badges should not be interactive in the usage guidelines ([#84920](https://github.com/WordPress/gutenberg/pull/84920)).
- `Tabs`: Preserve intrinsic icon styles in the tab icons and tooltips story ([#84618](https://github.com/WordPress/gutenberg/pull/84618)).
- Document accessible naming for Combobox popups ([#84551](https://github.com/WordPress/gutenberg/pull/84551)).
- Add popup width stories for Autocomplete, Combobox, Select, SearchableSelect, and SearchableChipSelect ([#84320](https://github.com/WordPress/gutenberg/pull/84320)).
Expand Down
17 changes: 15 additions & 2 deletions packages/ui/src/badge/stories/usage-guidelines.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@ import * as UsageGuidelinesStories from './usage-guidelines.story';

# Badge usage guidelines

## Choosing intent
## Badges should not be interactive

Badges communicate status or metadata. They should not perform actions or navigate to another page.

### ❌ Don't

- **Use badges as links or buttons.** Do not add click handlers or make badges focusable to trigger actions or navigation.

### ✅ Do

- **Use badges to communicate status or metadata.** Keep any related action separate from the badge.
- **Use the appropriate interactive component.** Use [Button](?path=/docs/design-system-components-button--docs) for actions and [Link](?path=/docs/design-system-components-link--docs) for navigation.

## Choose badge intent based on the attention a status needs

<Canvas of={ UsageGuidelinesStories.AllIntents } />

Expand Down Expand Up @@ -110,7 +123,7 @@ Use the least attention‑grabbing intent that still:
- Marks what isn't final, or
- Confirms a key success state in that context.

## Using with icons
## Keep icons outside badges

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @jameskoster to FYI

We may want to revise these guidelines at some point, but I believe they reflect current advice


`Badge` is text-only. Intent is communicated through color and label — not through icons inside the badge.

Expand Down
Loading