Overview

Use a badge to show the status or a key attribute of something at a glance, such as whether an assessment has been marked, or the topic of a question.

Badge anatomy

#PartDescription
1ContainerCarries the colour (theme) and strength (emphasis). 8px corner radius.
2Icon (optional)Badge.Icon, or an Icon child. Reinforces the label, never replaces it.
3LabelBadge.Text, or plain text. One or two words, in sentence case.

Do's and Don'ts

    Do

    Use badges to highlight important information.

    Don't

    Use badges to filter a list. Use Chip Toggle Group instead.

    Do

    Use badges for short, scannable status.

    Don't

    Show a count on a navigation item. Use Notification Badge instead.

    Do

    Keep labels to one or two words, in sentence case.

    Don't

    Put a sentence in a badge. Use Inline Message or helper text instead.

Choosing a theme

Semantic themes carry meaning. Use them only for status, and always with the same meaning:

ThemeUse forExamples
successDoneMarked, Completed
warningNeeds actionAwaiting marking
dangerLate or failedOverdue
infoPlanned or under wayScheduled, In progress
neutralNot started or inactiveNot started, Archived

Non-semantic themes (blue, purple, teal and others) carry no meaning. Use them for categories such as topics or delivery mode, and give each category one colour everywhere it appears.

Choosing an emphasis

  • Subtle (default): use it almost everywhere, including dense tables and lists.
  • Bold: use it only for the single most important status on a screen.
  • White: use it on grey or coloured backgrounds, where a subtle badge would blend in.

Size

Use sm (default) in most places. Use xs in dense tables and compact cards, and md next to large headings. Use the same size for every badge in a group.

The three badge sizes side by side

Long labels

Keep labels to one or two words, in sentence case. In tables, set overflow="ellipsis" so rows keep an even height: the label is cut off and the full text shows in a tooltip. Elsewhere, labels wrap.

A long label cut off in a table, with the full label in a tooltip

Clickable badges

Semantic badges are never clickable. A non-semantic badge can be, for example a topic badge that links to that topic. Give it an href or onClick and it gets a pointer and a hover style. Semantic badges ignore both.

Accessibility

  • Never rely on colour alone. The label must make sense without its colour. Add an icon to semantic statuses.
  • Keep labels short. One or two words. In tables, use overflow="ellipsis" so the full label is still available in a tooltip.

Structure and spacing

Badge sizes

PropertyTokenpxrem
Border radiusradius-md8px0.5
Borderwhite1px-

Badge size and spacing

Property - sizeTokenpxrem
Height - md-38px-
Height - sm-34px-
Height - xs-27px-
Padding x - mdspace-28px0.5
Padding x - sm & xsspace-14px0.25
Padding y - mdspace-14px0.25
Padding y - smspace-0.52px0.125
Padding y - xs-0px0
Icon size (all sizes)sm16px1
Icon to text gapspace-14px0.25

Heights include the 1px border.

Typography

Badge typography

Badge sizeFamilyWeightText sizeRempx
mdbody400md1rem16
smbody400md1rem16
xsbody400sm0.875rem14

Colour

Badge semantic colours by emphasis

ThemeSubtle textSubtle bgBold textBold bgWhite text
Infoinfo-midinfo-lightwhiteinfoinfo
Neutralgrey-900grey-100whitegrey-800grey-800
Successsuccess-midsuccess-lightwhitesuccesssuccess
Dangerdanger-middanger-lightwhitedangerdanger
Warningwarning-textwarning-lightgrey-1000warningwarning-text

Non-semantic themes follow the same pattern using the -1000 step for subtle text, -200 for subtle background and -800 for bold background and white-emphasis text, with a few overrides for contrast (e.g. yellow, lime and orange use dark text on bold).

Options

OptionIn codeValuesDefault
Themetheme5 semantic and 17 non-semantic coloursinfo
Emphasisemphasissubtle, bold, white. Can change by breakpoint.subtle
Sizesizexs, sm, md. Can change by breakpoint.sm
Overflowoverflowwrap, ellipsis (shows a tooltip when cut off)wrap
IconBadge.IconAny icon, before or after the labelNone

Related