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:
"design-system": "git+ssh://git@github.com/Selectra-Dev/design-system.git"
@import 'design-system/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.
h3 heading Small size
h3 heading Medium size
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.
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.