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
Show editable code example
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
Default'span'Specifies element type for this component
- variant
enum
'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark'Default'primary'Visual style of the badge
- pill
bool
DefaultfalseAdd the
pill
modifier to make badges more rounded with some additional horizontal padding - bsPrefix
string
Default'badge'Overrides underlying component base CSS class name
Usage Insights#
Badge
Project Name | Paragon Version | Instance Count | |
---|---|---|---|
frontend-app-admin-portal | 20.46.3 | 17 | |
frontend-app-authn | 20.46.2 | 1 | |
frontend-app-course-authoring | 20.46.2 | 9 | |
frontend-app-discussions | 20.44.0 | 3 | |
frontend-app-ecommerce | 20.46.2 | 2 | |
frontend-app-enterprise-public-catalog | 20.46.3 | 14 | |
frontend-app-learner-dashboard | 20.46.2 | 5 | |
frontend-app-learner-portal-enterprise | 20.45.4 | 17 | |
frontend-app-learner-record | 20.46.3 | 5 | |
frontend-app-learning | 20.46.0 | 1 | |
frontend-app-library-authoring | 21.5.6 | 2 | |
frontend-app-ora-grading | 20.46.3 | 1 | |
frontend-app-payment | 20.46.2 | 1 | |
frontend-app-publisher | 20.46.2 | 1 | |
frontend-app-support-tools | 20.46.0 | 4 | |
frontend-component-header-edx | 21.5.6 | 2 | |
catalog-search | 20.45.0 | 3 | |
frontend-lib-content-components | 21.5.6 | 2 | |
prospectus | 20.46.2 | 8 |