Badges are small status indicators, a badge consists of a small box typically containing a number or a small phrase that appears next to another element.
Overview
Badges can be used in different ways, such as notification, to catch up attention, etc. It matches the size of its immediate parent by using relative font sizing em
units.
New messages 6
Lorem consectetur adipisicing amatory!
New! Look at that! Nice! Gloups ?! Who turns the light off? Much white!
Usage
Dependencies
To get the badge component working, include the dependencies in your project in the following order:
"integration-common-files": "git+ssh://git@github.com/Selectra-Dev/integration-common-files.git"
@import 'integration-common-files/src/scss/01-atoms/badge';
Basic code
The badge is composed by a span tag with the class badge
Modifiers
Add any of the following modifier to change the appearance of a badge:
Sizes
Size modifier allows you to change the font sizing ratio of the badge and its paddings.
Small
h3 heading Small size
Medium
h3 heading Medium size
Large
h3 heading Large size
<!-- Small -->
<span class="badge badge--sm"></span>
<!-- Medium -->
<span class="badge badge--md"></span>
<!-- Large -->
<span class="badge badge--lg"></span>
//- Small
span.badge.badge--sm
//- Medium
span.badge.badge--md
//- Large
span.badge.badge--lg
Colors
7 colors are available based on the main colors of the theme used in your project, all you have to do is adding the modifier class mentionned below.
Primary Secondary Success Warning Danger Grey White
<!-- Primary -->
<span class="badge badge--primary"></span>
<!-- Secondary -->
<span class="badge badge--secondary"></span>
<!-- Success -->
<span class="badge badge--success"></span>
<!-- Warning -->
<span class="badge badge--warning"></span>
<!-- Danger -->
<span class="badge badge--danger"></span>
<!-- Grey -->
<span class="badge badge--grey"></span>
<!-- White -->
<span class="badge badge--white"></span>
//- Primary
span.badge.badge--primary
//- Secondary
span.badge.badge--secondary
//- Success
span.badge.badge--success
//- Warning
span.badge.badge--warning
//- Danger
span.badge.badge--danger
//- Grey
span.badge.badge--grey
//- White
span.badge.badge--white
Pill
Badge can take the shape of a pill (round corners) using the modifier below.