Skip to content

Add Badge component#82

Merged
koppen merged 5 commits intomainfrom
koppen/badge-components
Feb 22, 2026
Merged

Add Badge component#82
koppen merged 5 commits intomainfrom
koppen/badge-components

Conversation

@koppen
Copy link
Copy Markdown
Member

@koppen koppen commented Feb 15, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a new Badge component to the Flowbite component library, based on the Flowbite design system. The implementation follows established patterns in the codebase and includes comprehensive test coverage and preview examples.

Changes:

  • Adds Flowbite::Badge component with support for multiple styles, sizes, borders, dots, and links
  • Adds Flowbite::Badge::Pill subclass for fully-rounded badge variants
  • Includes comprehensive test suite covering all component features and variants
  • Provides Lookbook preview examples demonstrating all badge variants

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
app/components/flowbite/badge.rb Main Badge component implementation with styles, sizes, and feature support
app/components/flowbite/badge/pill.rb Pill variant subclass overriding styles for fully-rounded corners
app/components/flowbite/badge/badge.html.erb ERB template rendering badge with optional dot indicator
test/components/flowbite/badge_test.rb Comprehensive test suite covering all badge features and variants
demo/test/components/previews/badge_preview.rb Lookbook preview examples for all badge variants
demo/.yardoc/* Auto-generated YARD documentation files
CHANGELOG.md Updated with Badge component addition

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 10 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +30 to +37
class << self
def classes(size: :default, state: :default, style: :brand)
styles.fetch(style).fetch(state) + sizes.fetch(size)
end

def sizes
SIZES
end
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Badge class is missing a sizes class method that returns the SIZES constant, which is a pattern used in other components like Button and Input. This method provides a way to access sizes from the current class rather than a parent class. Consider adding def sizes; SIZES; end inside the class << self block for consistency with other components.

Copilot uses AI. Check for mistakes.
@koppen koppen force-pushed the koppen/badge-components branch from 3323cba to f0a2351 Compare February 18, 2026 15:36
@koppen koppen requested a review from Copilot February 18, 2026 15:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 10 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@koppen koppen force-pushed the koppen/badge-components branch from f0a2351 to 4a1c67e Compare February 22, 2026 13:30
@koppen koppen force-pushed the koppen/badge-components branch from 4a1c67e to 5ddc5af Compare February 22, 2026 13:31
@koppen koppen merged commit e4c5e2c into main Feb 22, 2026
6 checks passed
@koppen koppen deleted the koppen/badge-components branch February 22, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants