Problem/Motivation
We need to develop a new Badge component that is fully compatible with Drupal Canvas and aligned with Bootstrap 5 standards.
The component should provide a reusable and flexible way to display small status indicators, labels, categories, and highlights across the site.

The Badge component will be used in cards, listings, taxonomy displays, notifications, and UI indicators where compact visual emphasis is required.
Key requirements:
- Bootstrap 5 compatible badge structure
- Canvas configuration support
- Configurable size options (Small, Medium, Large)
- Background style options (Default, Outline, Soft)
- Optional link support
- Rounded / pill style option
- Responsive behavior
- No inline CSS/JS (SCSS-based styling only)
Steps to reproduce
- Add the Badge component in Drupal Canvas.
- Enter badge text.
- Select size option.
- Choose style (Default, Outline, Soft).
- Enable optional link if required.
- Test inside different components (Card, Hero, Taxonomy, etc.).
The component should render consistently using Bootstrap utility classes and adapt properly across different layout contexts.
Proposed resolution
- Develop a new Badge component following Bootstrap 5 badge structure.
- Implement configurable size options using Bootstrap utility classes.
- Add style variations (solid, outline, soft background).
- Provide optional link functionality with proper semantic markup.
- Implement rounded (pill) style toggle.
- Ensure responsive rendering across devices.
- Move all styling to SCSS and remove inline CSS/JS.
- Ensure full Canvas schema compatibility.
The Badge component will provide a lightweight, reusable, and consistent visual indicator aligned with Varbase and Bootstrap 5 architecture standards.
Remaining tasks
- ✅ File an issue about this project
- ❌ Addition/Change/Update/Fix to this project
- ❌ Testing to ensure no regression
- ➖ Automated unit/functional testing coverage
- ➖ Developer Documentation support on feature change/addition
- ➖ User Guide Documentation support on feature change/addition
- ➖ UX/UI designer responsibilities
- ➖ Accessibility and Readability
- ❌ Code review from 1 Varbase core team member
- ❌ Full testing and approval
- ❌ Credit contributors
- ❌ Review with the product owner
- ❌ Update Release Notes
- ❌ Release
Varbase update type
- ✅ No Update
- ➖ Optional Update
- ➖ Forced Update
- ➖ Forced Update if Unchanged
User interface changes
- N/A
API changes
- N/A
Data model changes
- N/A
Release notes snippet
- N/A
| Comment | File | Size | Author |
|---|---|---|---|
| Badge-Component-My-Varbase-site (1).png | 319.08 KB | alamgir.hossain.cse |
Issue fork vartheme_bs5-3575045
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
alamgir.hossain.cse commentedComment #4
rajab natshahUse ready
badgeclasses as fromhttps://getbootstrap.com/docs/5.3/components/badge/
No custom classes
Follow with Bootstrap 5.3.8
Comment #5
alamgir.hossain.cse commentedComment #7
rajab natshahComment #8
rajab natshah