A badge is a visual indicator only for numeric values. It is static and not interactive. There are two variants:
Badges come in 2 colours. The default is black. Use any of the flavours to style badges that have semantic or otherwise colour-coded meaning:
Badges can be added to chips.
Badges can be added to tabs.
Badges can be added to side navigation links.
To import just this component into your project, copy the snippet below and include it in your main Sass file.
// import Vanilla and include base mixins
// this only needs to happen once in a given project
@import 'vanilla-framework';
@include vf-base;
@include vf-p-badge;
For more information see Customising Vanilla in your projects, which includes overrides and importing instructions.
You can use badge in React by installing our react-component library and importing Badge
component.