markusenglund / react-switch

A draggable toggle-switch component for React. Check out the demo at:
https://react-switch.netlify.com/
MIT License
1.33k stars 100 forks source link

Can we somehow add image to the round toggle switch? #57

Closed alishajain7 closed 3 years ago

alishajain7 commented 4 years ago

As per my UI design, I want to customise the toggle switch. Is there a way to do that? Any help will be appreciated. Thanks

toggle

saysmaster commented 4 years ago

Any help on that. Our design needs that too.

toggle-with-icon

Thanks.

sjarva commented 4 years ago

It is fairly simple to add an icon to the handle is stead of the background area. But, from a possible contributor's point of view, having answers to these questions would be helpful:

  1. Would your design hope for two different icons (based on the state of the switch, one icon for checked, another for unchecked state) or would just the one icon be enough? (If there are two different icons, the transition from state to another will need more fine-tuning, it's a lot easier to have just one icon.)
  2. Would the color of the icon change based on the switch state or stay the same?
  3. Would it be allowed to have an icon both at the handle and at the background, or could you pick only one? The example @Qubaish provided in #55 had both, the above designs don't :)
markusenglund commented 3 years ago

Sorry for not responding earlier.

73 has been merged and will be included in version 6.0.0. Closing the issue.