Skip to content

Add Badge component#82

Open
koppen wants to merge 5 commits intomainfrom
koppen/badge-components
Open

Add Badge component#82
koppen wants to merge 5 commits intomainfrom
koppen/badge-components

Conversation

@koppen
Copy link
Member

@koppen koppen commented Feb 15, 2026

Copy link
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
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.
Primarily to extract the size class names
@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
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.

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.

1 participant

Comments