Skip to content
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

[Feature Request] Set colors for true and false for the switch element #7284

Closed
fr4gst4 opened this issue May 24, 2019 · 6 comments
Closed
Assignees
Labels
C: Selection controls T: enhancement Functionality that enhances existing features T: feature A new feature

Comments

@fr4gst4
Copy link

fr4gst4 commented May 24, 2019

Problem to solve

Currently it is possible to set a color for switches when they return a true value. When they return false, their color is white.

It would be possible to have a green color for true and a red color for false.

Proposed solution

Currently you can solve the problem with some custom CSS

https://codepen.io/DutchmanSA/pen/rgdzBq

but it would be nice to have two color properties like

activeColor="success"
inActiveColor="error"

@ghost ghost added the S: triage label May 24, 2019
@dsseng dsseng added T: enhancement Functionality that enhances existing features T: feature A new feature and removed S: triage labels May 30, 2019
@kosratdev

This comment has been minimized.

@johnleider
Copy link
Member

This Issue is being closed due to inactivity.

If you have any questions, please reach out to us in our Discord community.

@batusekerci

This comment was marked as outdated.

@SteamWind
Copy link

I feel like the switch component could be really improved and this feature would be a great one to add. You can see, a lot of users upvoted the idea.
A switch should be something to select between two states. Be able to document those states with different colors is a good idea.
In the same direction, being able to have a label on each sides would be great...

@johnleider johnleider self-assigned this Jul 24, 2023
@johnleider johnleider reopened this Jul 24, 2023
johnleider added a commit that referenced this issue Jul 24, 2023
@SteamWind
Copy link

Thank you for this @johnleider ! 😄
That was quick!

@johnleider
Copy link
Member

Thank you for this @johnleider ! 😄 That was quick!

I happened to be in the file when I read your comment so you got lucky :)

blalan05 pushed a commit that referenced this issue Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Selection controls T: enhancement Functionality that enhances existing features T: feature A new feature
Projects
None yet
Development

No branches or pull requests

7 participants