Counter Badge

Example


<vega-counter-badge
    color="bg-danger|bg-action"
    dot="false"
    count="9"
>
    <vega-button>Button Example</vega-button>
</vega-counter-badge>
document.querySelector('vega-counter-badge').offset = [
    5,0
];

Example using Dot


<vega-counter-badge
    color="bg-danger|bg-action"
    dot="true"
    count="9"
>
    <vega-button>Button Example</vega-button>
</vega-counter-badge>

Usage

The counter badge is a specific type of badge to show the increment of items.

It may be used for notifications, shopping carts, or other badges where more than one item is represented.

Counter badges have two types:

  • The normal type, which includes a small circle including a number indicating a number of items which may be accessible upon selection.
  • The dot type, which is a simple circle indicator without a number indicating that actions may be taken on an element.

Properties

Name Description Default
color Customize the Badge color. Currently only supports bg-danger and bg-action bg-danger
dot Display a dot badge if set to be true. This provides no specific count. boolean false
count Number to show in badge
number
0
offset Set offset [left, top] of the badge from it’s default position on the top right corner
array
0,0

Accessibility

  • Inline text spacing must be adjustable with custom stylesheets
  • id attribute value must be unique