-
-
Notifications
You must be signed in to change notification settings - Fork 922
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
Badge should have a color
property
#1033
Comments
@rehandalal You can change color by this way:
<Badge className="green">
<Button>New Message</Button>
</Badge>
.rs-badge.green .rs-badge-content{
background: #008000;
} And we will consider your advice.Thank you for you feedback. |
Thanks! This is what I am currently doing. But it would nice to have it just work out-the-box. |
We will consider how to realization it better in the subsequent version. |
It can be designed to be consistent with the button color, while supporting custom colors. |
Supported in rsuite v5.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What problem does this feature solve?
Sometimes you want the
Badge
to be different colors. I tried following the example in the docs and when theBadge
is not wrapped around an element setting the background color changes the color of theBadge
:When wrapped around a button however the background of the button changes to the expected color but not the
Badge
:In this case I am using badge as status indicator --- green for good and red for bad.
What does the proposed API look like?
The proposed API would be similar to
Tag
orButton
where you pass through acolor
property and that is used to set the color of theBadge
.Alternatively perhaps it should pass the
className
andstyle
properties down to the.rs-badge-content
element when the badge is wrapping an element.The text was updated successfully, but these errors were encountered: