ClickorAltL

Dragto resize

Nord Design System SearchDeveloperDeveloperGetting startedUsing Web ComponentsWebfontsCDNLocalizationCSS Framework Legacy ESLint PluginWorking with AIFAQDesignDesignGetting startedFoundationsThemesBrand assetsToolsComponentsComponentsAccordion New Aside New Autocomplete New AvatarBadgeBanner Updated ButtonButton GroupCalendar Updated CardCheckbox Updated Collapsible New Combobox New Command MenuDate Picker Updated Date Range Picker New DividerDrawerDropdownEmpty StateField New FieldsetFilter Bar New FooterHeaderIconInput Updated Item New Kbd New LayoutMessageMeter New ModalNavigationNotificationNumber Field New Otp Field New Outline New Pagination New Popout Updated ProgressProgress BarQrcodeRadio Updated Range Updated Scroll Area New Segmented ControlSelect Updated SkeletonSpinnerStackTabTableTagTextarea Updated Time Picker New ToastToggle Updated TooltipTop BarTruncate New Visually HiddenDesign TokensDesign TokensTailwind CSSTailwind CSSBlocksBlocksTemplatesTemplatesIconsIconsPlaygroundPlaygroundLatest UpdatesLatest UpdatesChangelogChangelogMigration guidesMigration guides
GitHub

Badge

Open in Storybook

Inform users of the status of an object or of an action that's been taken.

Loading...

Usage

Badges inform users of the status of an object or of an action that's been taken. They're commonly used in tabular data to indicate status, and can carry an optional icon in the icon slot.

Copy code
import "@nordhealth/components/lib/Badge"

Examples

Variants

The variant attribute sets the badge colour to communicate meaning, from strongly positive through neutral to strongly negative.

With icon

Place an icon in the icon slot to reinforce the badge's meaning.

Strong

The strong attribute is a secondary style that gives the badge more visual prominence.

Inline with text

A badge sits inline alongside headings or other text.

Variant scale

How each variant maps onto the strongly-positive through strongly-negative scale.

Progress states

Use badges with icons to communicate progress, from complete through cancelled.

In a table

Badges commonly indicate row status in tabular data.

Vertically aligned with text

A badge aligned alongside a value and supporting text, as in a metric summary.

RTL

Badges follow the document or container direction. Toggle the direction to see the layout mirror.

Accessibility

  • A badge conveys meaning through colour, so make sure the text content states the status clearly on its own. Don't rely on colour alone.
  • When you add an icon in the icon slot, give it a label if the icon carries meaning the text doesn't already convey; otherwise leave it unlabelled so it stays decorative.
  • Keep badge text short and descriptive so it remains readable at the badge's small size.

API reference

Badge

Badges are used to inform users of the status of an object or of an action that’s been taken. Commonly used in tabular data to indicate status.

<nord-badge></nord-badge>

Props

PropertyAttribute Description TypeDefault
variantvariantThe style variant of the badge. Determines the background color of the badge.'warning' | 'success' | 'danger' | 'highlight' | 'neutral' | 'info' | undefined"neutral"
strongstrongStrong badges are a secondary style for badges. They provide more visual prominence and emphasize them.booleanfalse

Slots

Slot name Description
Default slotThe badge content.
iconUsed to place an icon at the start of badge.
Design guidelinesFor designers

Usage

This section includes guidelines for designers and developers about the usage of this component in different contexts.

Do

  • Use established variants and color patterns so that users can clearly identify the importance level.
  • Use to show a status update on a piece of information or action.
  • Use to mark something as a “draft” or “new”.
  • Use when you want to highlight something that has been added recently.
  • Always position badge so that it’s easy to understand what object it’s related to.

Don’t

  • Don’t make badges clickable. Instead use button component’s small variant.
  • Don’t use alternatives to existing badge variants.
  • Don't use badges for labeling, categorizing, or organizing objects. Use the tag component instead.

Content guidelines

Badge labels should use a single word to describe the status of an object. Only use two words if you need to describe a complex state:

Complete
Action completed

When writing badge labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):

Partially refunded
Partially Refunded

Avoid unnecessary words and articles in badge labels, such as “is”, “the”, “an” or “a”:

Pending
Item is pending

Always describe the status in the past tense:

Refunded
Refund

Variants

This section describes the different component variants, their purpose, and when to use each variant.

NamePurpose
neutralThe default style variant.
infoUsed to convey general information that isn’t critical.
successUsed to convey success states. For example, you might want to show a badge that tells the user a payment was successful.
highlightUsed to highlight specific items in the interface, like notifications.
dangerUsed to communicate problems that have to be resolved so that user can continue forward. Should always be used for highlighting errors.
warningUsed to display information that needs a user’s attention attention and may require further steps.
progressUsed to convey something that’s in progress.