I needed the ability to set the class names of the specific elements within the toggle. An example would be using something like Bootstrap where you get classes like .bg-good: https://getbootstrap.com/docs/4.4/utilities/colors/
Currently react-toggle is designed in the fact that you edit your own CSS but in my case I needed to change the classNames because the CSS file was generated and provided elsewhere.
Disabled variants are not needed right now since the opacity and general "can't click it" interaction is already there. Potential future additions like trackClassNameDisabled may be useful.
These types of "inject a class name to an inner component" was inspired by https://github.com/wojtekmaj/react-date-picker#readme where you are able to provide a few more individual class names to internal components.
As a bonus I've added an additional test for disabled + click.
I needed the ability to set the class names of the specific elements within the toggle. An example would be using something like Bootstrap where you get classes like
.bg-good
: https://getbootstrap.com/docs/4.4/utilities/colors/Currently react-toggle is designed in the fact that you edit your own CSS but in my case I needed to change the classNames because the CSS file was generated and provided elsewhere.
Disabled variants are not needed right now since the opacity and general "can't click it" interaction is already there. Potential future additions like
trackClassNameDisabled
may be useful.These types of "inject a class name to an inner component" was inspired by https://github.com/wojtekmaj/react-date-picker#readme where you are able to provide a few more individual class names to internal components.
As a bonus I've added an additional test for disabled + click.