Skip to content

Allow Variant to be Specified for Navbar Item Badge #1690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JonPurvis
Copy link

@JonPurvis JonPurvis commented Jun 14, 2025

The scenario

When using the Navbar component and you want to add a Badge to a Navbar Item, you currently can't specify the variant of the badge you want to use, whilst you can change the colour, there's no variant option.

The problem

The normal Badge component allows you to specify variant="solid", which renders a bold, high contrast badge. The navlist/badge.blade.php doesn't have this option though, so you're left with a faded version.

The solution

I've taken inspiration from how the normal Badge component handles the solid variant and made it possible, much like badge-color, to pass in badge-variant. Within the blade file, I've just copied the existing code from badge.blade.php as that works fine.

Screenshots

Before

Screenshot 2025-06-14 at 19 04 59

After

Screenshot 2025-06-14 at 19 03 10

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