Theme

npm_versionnpm Paragon package page

Badges are composed of text and an accompanying indicator color, and are typically used to add meaning, status, or context when paired with another component.

  • Use badges paired with another component to convey status, or provide additional details
  • Don’t use badges for freestanding text on a page

This is a pass through component from React-Bootstrap.
See React-Bootstrap for additional documentation.

Basic Usage

Any Paragon component or export may be added to the code example.

Theme Variables (SCSS)#

$badge-font-size: 75% !default;
$badge-font-weight: $font-weight-bold !default;
$badge-padding-y: .125rem !default;
$badge-padding-x: .5rem !default;
$badge-border-radius: .25rem !default;
$badge-transition: none !default;
$badge-focus-width: $input-btn-focus-width !default;
$badge-pill-padding-x: .6em !default;
$badge-pill-border-radius: 10rem !default;

Props API#

Badge Props API
  • as elementType

    Specifies element type for this component

    Default'span'
  • variant enum'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark'

    Visual style of the badge

    Default'primary'
  • pill bool

    Add the pill modifier to make badges more rounded with some additional horizontal padding

    Defaultfalse
  • bsPrefix string

    Overrides underlying component base CSS class name

    Default'badge'

Usage Insights#

Badge

Project NameParagon VersionInstance Count
frontend-app-admin-portal21.13.117
frontend-app-authn22.7.01
frontend-app-course-authoring22.6.111
proctoring22.6.11
xpert_unit_summary22.6.11
frontend-app-discussions22.1.13
frontend-app-ecommerce20.46.32
frontend-app-enterprise-public-catalog21.13.18
frontend-app-learner-dashboard22.7.05
frontend-app-learner-portal-enterprise21.13.119
frontend-app-learner-record22.7.05
frontend-app-learning22.3.01
frontend-app-library-authoring21.11.32
frontend-app-ora-grading21.11.31
frontend-app-payment22.1.11
frontend-app-publisher20.46.31
frontend-app-support-tools20.46.04
frontend-component-header-edx21.11.42
catalog-search21.13.13
frontend-lib-content-components22.0.02
prospectus20.46.27