aaronshaf / react-toggle

Elegant, accessible toggle component for React. Also a glorified checkbox.
http://aaronshaf.github.io/react-toggle/
MIT License
945 stars 159 forks source link

Is there any way to easily control the size of the toggle? #170

Open oriooctopus opened 3 years ago

oriooctopus commented 3 years ago

I think that controlling the size of the toggle is a common use case (in my case, I want it about 25% smaller), but I can't see any way to adjust it. Am I missing something?

dawidmucha commented 3 years ago

Ideally, there would be a component property called "scale", or it would work that the toggle fully fits into the parent container, but you can hard-code your desired size(width and height) inside react-toggle-track and react-toggle-thumb classes.

Xiaokun-Xu commented 1 month ago

You can apply a scale transform to class react-toggle, like transform: scale(0.8)