Skip to content
Bugwise
Menu
UI Components

Badge

The little red number on a tab, the dot on an avatar, the "Sale" label on a product. Learn count, dot and status badges, app icon badges on iOS and Android, and the zero, overflow, stale count and accessibility bugs testers find in them.

35 min Feedback & overlays iOS · Android · Web Also called: Notification badge, Counter, Dot indicator, Status badge, Pill

A red 3 on the Chats tab. A dot on the bell. Sale −20% on a pair of running shoes. A 12 on your banking app’s icon that won’t go away, no matter how many times you open the app.

Badges are tiny, but they make a promise: “there’s something here for you”. When the promise is wrong (a “0” that should be gone, a count that never updates, a number nobody can hear) users stop trusting it, or they open the app twenty times a day for nothing. Here’s how to test them.

What is a badge?

A badge is a small marker attached to another element (an icon, a tab, an avatar, a card) that adds a bit of status. It doesn’t do anything on its own; tapping the badge is tapping the thing it sits on.

There are three kinds, and it’s worth naming them correctly in bug reports:

KindLooks likeMeansExample
Count badgeSmall pill with a numberHow many new thingsChats 3, cart 2
Dot badgeSmall dot, no numberSomething new, or a presence stateDot on the bell, green dot on an avatar
Status label (pill, tag)Word in a colored pillA property of the itemNew, Sale −20%, Sold out, In transit

Count and dot badges are about attention and change all the time. Status labels describe the item and change with its data. Both are UI stateUI stateHow a component looks and behaves in a given situation: default, hover, pressed, focused, disabled, loading, error.Open in glossary → that has to match the real data behind it.

Anatomy

  1. 1

    Anchor

    The icon, tab, avatar or card the badge belongs to. The badge sits on its corner and must never hide it.

  2. 2

    Count badge

    A number: unread messages, items in the cart. Capped ("99+") and hidden at zero.

  3. 3

    Dot badge

    No number, just "something new here". Also used for presence (online) on avatars.

  4. 4

    Status label (pill)

    "Sale −20%", "Sold out", "In transit". A word that describes the item, not a count. The text carries the meaning, color only supports it.

  5. 5

    Separator ring

    A thin outline in the background color, so the badge stays readable on top of the icon or photo.

  6. 6

    Accessible name

    Not visible, but essential: the screen reader must hear the count with the anchor, e.g. "Messages, 3 unread".

Designs & variants

Several of these react to taps. Use the switch to compare light and dark.

Tab bar badge

iOS

Red pill with a white number on the top-right of the icon. Tap Chats: the badge disappears when the messages are read.

Small and large badges

Android · Material 3

A 6 dp dot for “something new”, a 16 dp badge for numbers. Material caps at four characters: 999+.

shop.example

Tap the bag to add items (caps at 9+, hides at 0).

Header icons

Web

Cart count and a notification dot. Each icon button needs a name that includes the count.

  • ANOnline
  • MKAway
  • JSOffline

Presence on avatars

iOS · Android · Web

Green, orange, nothing. Without the text below, colorblind and screen reader users can't tell who's online.

Trail runner 2Sale −20%
City sneakerNew
Rain jacketSold out
Wool socksOnly 2 left
Order #4821In transit

Status labels (pills)

iOS · Android · Web

Words, not numbers: Sale, New, Sold out. The word carries the meaning; the color is a bonus.

iOS
Android dot
No badge

App icon badges

iOS · Android

Set by the OS from the app's notifications. iOS shows a number (if the user allows badges); Android launchers usually show a dot.

Where badges sit

  • On icons in tab bars and navigation bars: the top-right corner of the icon, overlapping it slightly, never covering it. See Navigation Bar and Tabs.
  • Inside a tab or list row: a counter next to the label (Inbox 24, Unread 3). Here it’s part of the text, not floating on top.
  • On avatars: a presence dot (online, away) in the bottom-right corner, with a ring in the background color so it stands out from the photo.
  • On cards and product tiles: a status label in a corner or next to the price, like the “Sold out” label on the Card page.
  • On the app icon: drawn by the operating system, not by the app. More on that below.

The rules for counts

  1. Zero hides the badge. “0” means “nothing new”, which is exactly what no badge says. A red “0” is a bug.
  2. Big numbers are capped. Exact counts above a limit don’t help anyone and break the layout. iOS apps usually show 99+; Material 3 allows at most four characters, so 999+.
  3. The number is the truth. It equals the number of unread (or new) things, not “how many arrived since you last looked”, unless the spec says otherwise.
  4. It updates when the truth changes. Reading a message, marking all as read, reading it on another device, deleting it: the badge follows, without a restart.
  5. It has words for screen readers. The visible “3” becomes “Chats, 3 unread” in the accessible name.

When does the count update?

Ask this before you test, because there are two valid designs:

Either way, the badge must be right after every way of reading: opening the item, “Mark all as read”, swiping it away, reading it on the web, and coming back from the background (Background and foreground). And when the user reads something, the badge should drop immediately, without waiting for the next sync.

App icon badges (iOS and Android)

The number or dot on the app icon is drawn by the system, so it follows the system’s rules:

  • iOS shows a red number on the icon. The app can only set it if the user allowed notifications with badges; the user can switch badges off per app in Settings › Notifications. The app (or its server, via the push payload) is responsible for setting it back to zero. A stuck icon badge is one of the most common badge bugs.
  • Android (8.0 and newer) shows notification dots: a dot appears while the app has active notifications, and long-pressing the icon shows them. Some launchers (Samsung, for example) can show a number instead. The dot disappears when the notifications are dismissed, so test dismissing them, not only opening the app. On Android 13+, notifications need a runtime permission, so no permission means no dot. See Push Notifications.
  • Web: installed web apps can set an icon badge where the browser and OS support it. Websites often put the count in the page title instead: (3) Inbox.
    Dev note
    Icon badges use the Badging API (navigator.setAppBadge()).

Push it to the limits

Try the counts testers always try: 0, 1, 99, 100, 1,000 and 12,345. Then shrink the screen, raise the text size and turn off the count in the accessible name.

🧪 Badge stress test

Feed the badge awkward numbers, shrink the screen and make the text huge. Watch the tab bar and what a screen reader would say.

Unread count: 3

Cap the number at

Only matters above the cap: try 100 or 1,000.

Style

Screen width: 360px

Text size: 100%

VoiceOver: "Chats, 3 unread, tab, 1 of 5"

Real count 3 · badge shows "3"

Looks good. Now try 12,345 with no cap, 0 without hiding, a 260px screen or 200% text.

When to use it

  • To show that new or unread things are waiting somewhere else: messages, notifications, order updates.
  • To show how many items are in a container the user cares about: cart, downloads queue.
  • To show a short status that helps users scan a list: Sale, New, Sold out, Delivered.
  • To show presence: online, away, busy.

Good and bad uses

No badge when there's nothing new

The Calls tab is quiet. Users can trust that a badge means something.

A badge that says 0

Red and alarming, but it means “nothing”. Users tap it anyway, every time.

Capped at 99+

Fits on the icon and says the same: “a lot”.

The exact four-digit count

“1284” is too wide for the tab and spills over the neighbor.

Status as a word

Trail runner 2€79.20Sale −20%
City sneaker€89.00New

“Sale −20%” and “New” are readable by everyone, including screen readers.

Status as a colored dot

Trail runner 2€79.20
City sneaker€89.00

Red means sale, green means new, if you can see the difference. Many people can’t.

Also avoid badges as decoration (a permanent “NEW” on a feature launched a year ago), badges on everything at once (if every tab has a badge, none stands out), and badges for things the user can’t act on.

Common bugs

#BugWhat you seeTypical severity
1Zero shownA red “0” instead of no badgeLow–Medium
2No cap“1000” or “12345” overflows the tab, overlaps the next icon or is cut offMedium
3Stale countBadge doesn’t drop after reading, only after restarting the appMedium
4Wrong countCounts messages instead of chats (or the other way round), counts read items, counts twiceMedium
5Stuck app icon badgeThe icon shows 12 even though everything is readMedium
6Count not spokenScreen reader says “Chats, tab” but not “3 unread”High (for affected users)
7Color-only statusSale and New differ only by red vs greenMedium
8Badge hides the anchorWith large text or on a small screen the badge covers the iconMedium
9Low contrastLight text on a bright red or a pastel pill; invisible in dark modeDark modeA display setting that uses light text on dark backgrounds.Open in glossary →Low–Medium
10Inconsistent countsTab says 3, the list shows 2 unread, the app icon says 5Medium
11Negative or nonsense values“-1” after deleting, “NaN”, “undefined”Medium
12Localization“99+” or “Sold out” not translated, or a long word like “Ausverkauft” truncatedLow–Medium

Find the bug

This messenger has six badge bugs. Explore it like a tester:

  • Look at every tab’s badge. Then visit each tab and come back.
  • Open a few unread chats and go back. Does the Chats badge agree with the list? Try Restart app.
  • Turn on Screen reader and tap a tab once to hear it (twice to open it).
  • Open Shop and turn on the grayscale color filter.
  • Turn on Larger text and look at the tab bar.

🐞 Bug hunt: Messenger badges

This demo has 6 hidden bugs. Explore it like a tester, then check your findings.

Found0/6
9:41

Chats

Device settings

  1. 1

    Hint: Open the Calls tab, then go back to Chats and look at the Calls icon.

  2. 2

    Hint: Look at the Channels tab badge, especially on the right edge of its tab.

  3. 3

    Hint: Open Ana's and Marko's chats, go back, and compare the badge with the list. Then tap Restart app.

  4. 4

    Hint: Turn on Screen reader, tap the Chats tab once, then a chat row once.

  5. 5

    Hint: Open Shop, read the legend, then turn on the grayscale color filter. Also try the screen reader on a product.

  6. 6

    Hint: Turn on Larger text and look at the Chats, Calls and Channels icons.

How to test it

Checklist

Badge test checklist

0 of 13 checked

Example test cases

TC-BDG-001Badge disappears at zero

Preconditions

  • 2 missed calls, Calls badge shows 2

Steps

  1. Open the Calls tab
  2. Go back to Chats

Expected result

The Calls badge is gone. No "0" is shown.

TC-BDG-002Count is capped above the limit

Preconditions

  • Test account with 99, then 100, then 1,284 unread items

Steps

  1. Open the app with 99 unread
  2. Receive one more item
  3. Switch to the account with 1,284 unread

Test data

Counts: 99, 100, 1,284

Expected result

Badge shows "99", then "99+", then "99+". It stays inside its tab on the smallest supported screen.

TC-BDG-003Badge updates after reading

Preconditions

  • 3 unread chats

Steps

  1. Open one unread chat and go back
  2. Use "Mark all as read"

Expected result

Badge shows 2 right after going back, then disappears after Mark all as read. No restart needed.

TC-BDG-004Badge syncs when read on another device

Preconditions

  • Same account on phone and web, 2 unread chats

Steps

  1. Read both chats on the web
  2. Return to the app on the phone (from the background)

Expected result

The tab badge and the app icon badge both clear within the expected sync time.

TC-BDG-005Screen reader announces the count

Preconditions

  • VoiceOver or TalkBack on
  • 3 unread chats

Steps

  1. Move focus to the Chats tab

Expected result

The screen reader says something like "Chats, 3 unread, tab, 1 of 5". After reading one chat, it says "2 unread".

TC-BDG-006Status labels without color

Steps

  1. Open the shop list
  2. Turn on a grayscale color filter (iOS: Accessibility › Display & Text Size › Color Filters; Android: Accessibility › Color correction or Developer options › Simulate color space)

Expected result

Every status (Sale, New, Sold out) is still readable as text.

TC-BDG-007App icon badge clears (iOS)

Preconditions

  • Notifications with badges allowed
  • App icon shows 4

Steps

  1. Open the app
  2. Read all 4 items
  3. Go to the home screen

Expected result

The app icon shows no badge.

Tip: click a test case to expand it.

Accessibility

Mobile vs web

  • Tab bar badges: red pill with white text by default.
    Dev note
    badgeValue on UITabBarItem (a string; "0" shows a zero) or .badge() in SwiftUI.
  • App icon badges need notification permission with badges. Test: allow, deny, and turning Badges off later in Settings › Notifications.
  • Push payloads can set the icon badge. Check it’s correct after a push arrives while the app is closed, and that it clears when the app is opened and the items are read.
  • Test with VoiceOver and the largest Dynamic Type size (long-press a tab bar item to see the large content viewer).
  • Material 3 badges: a 6 dp dot or a 16 dp badge with up to four characters (“999+”).
    Dev note
    Badge / BadgedBox (Compose) or BadgeDrawable (Views).
  • App icons show notification dots on most launchers; the dot follows the app’s active notifications. Test dismissing notifications, and the Notification dot setting in system settings.
  • Android 13+ asks for notification permission; without it there are no notifications and no dots (App permissions).
  • Test with TalkBack, a large font size and display size, and on a narrow phone in landscape.
  • Badges are usually custom <span>s. Check the button’s accessible name in DevTools’ Accessibility pane: does it include the count?
  • The page title count (3) Inbox and installed web apps’ icon badges (where supported) must match the in-page badge.
    Dev note
    Icon badges are set with navigator.setAppBadge().
  • Test at 200% zoom and narrow viewports: header badges often overlap the logo or the next icon (Responsive design testing).
  • Check realtime updates in two browser tabs: read in one, watch the other.

Check your understanding

Quick quiz

0/5 answered · 0 correct

  1. 1.All messages have been read. What should the Chats tab badge show?

  2. 2.There are 1,284 unread updates. What is the usual way to display that on a tab bar icon?

  3. 3.VoiceOver says "Chats, tab, 1 of 5" while the badge shows 3. What is wrong?

  4. 4.A shop marks sale items with a red dot and new items with a green dot. What do you report?

  5. 5.The badge drops only after restarting the app. Which test found it?

Key takeaways

  • Three kinds: count badges, dot badges and status labels. Name them correctly in bug reports.
  • Zero hides the badge, big numbers are capped (99+, 999+), and the badge stays inside its space without hiding the icon.
  • The count is data: it must match the list, update immediately when items are read, and agree with the app icon badge.
  • App icon badges belong to the OS: on iOS they need notification permission with badges; on Android they’re usually dots tied to active notifications.
  • Accessibility: the count goes into the accessible name (“Chats, 3 unread”), status uses words, not only color, and contrast is checked in light and dark mode.

Finished this page?Nice work, this page is complete!

Mark it as done to track your progress. It's saved in this browser, no account needed.

Its review cards are now in Bites ⚡
Esc

Type to search the whole site.