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

Feat: Add option to change boolean field color (version without toggle) #6404

Open
damien-louis opened this issue Aug 7, 2024 · 1 comment

Comments

@damien-louis
Copy link

Short description of what this feature will allow to do:
When a BooleanField is used with renderAsSwitch(false), the rendering is :

<span class="badge badge-boolean-true">
    Yes
</span>

and

<span class="badge badge-boolean-false">
    No
</span>       

Yes button with blue background, No button with grey background.

It would be great to have an option to change background color (with bootstrap class for example) for a better UX (sometimes the true is a good news, sometimes a bad...

Example of how to use this feature

BooleanField::new('isDone')->renderTrue('success')->renderFalse('primary');
BooleanField::new('isBroken')->renderTrue('danger')->renderFalse('success');

Maybe it can be my first contribution if the idea is validated.

@damien-louis
Copy link
Author

What do you think about this @javiereguiluz?

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

No branches or pull requests

1 participant