Badge Count

A numeric label used to display things like version number or collection enumerations.

Use BadgeCount as a numeric label to display version numbers, collection counts in tabs, and similar information. For non-numeric information, use Badge.

Usage

When to use

  • To display version numbers (ie. “v1.2.0”), collection counts in tabs, and similar information.

When not to use

  • To display non-numeric information, consider Badge.

Type

There are three types of BadgeCounts: filled, inverted, and outlined.

3
3
3

Color

There are two colors: neutral, and neutral-dark-mode.

3
3

Size

There are three sizes: small, medium, and large.

3
3
3

How to use this component

Basic

The most basic invocation requires the text argument to be passed. By default, a filled, medium size, neutral color badgeCount is generated.

3
<Hds::BadgeCount @text="3" />

Type

A different type of badgeCount can be invoked using the type argument.

3
<Hds::BadgeCount @text="3" @type="inverted" />

Size

A different size of badgeCount can be invoked using the size argument.

3
<Hds::BadgeCount @text="3" @size="large" />

Color

A different color of badgeCount can be invoked using the color argument.

3
<Hds::BadgeCount @text="3" @color="neutral-dark-mode" />

Component API

Name
size
Type
enum
Values
  • small
  • medium (default)
  • large
Name
type
Type
enum
Values
  • filled (default)
  • inverted
  • outlined
Name
color
Type
enum
Values
  • neutral (default)
  • neutral-dark-mode
Name
text
Type
string
Description
The text value that should go in the badge counter.
Name
…attributes
Description
...attributes spreading is supported on this component.

Showcase

Content

3
99+
v1.2.3

This is a paragraph:

3

Size

Small
Medium
Large

Type

Filled
Inverted
Outlined

Color:

Neutral
3
3
3
3
3
3
3
3
3
Neutral-dark-mode
3
3
3
3
3
3
3
3
3

Conformant

When used as recommended, there should not be any accessibility issues with this component.