Perspective toggle switch size

Well, for starters. There is no system default toggle switch in regards to the browser. Toggle switches are either a checkbox element or a tree of divider elements configured to provide the appearance and behavior of a toggle switch. In our case it is the latter, although our initial implementation was a checkbox. We could dynamically scale the toggle switch and all it’s internal elements, but this could lead to other problems as a result of making things way more complex than they need to be.

Currently our toggle switch is modeled after native Android toggle switch design. IOS, by design is 4px larger (not including the track). See https://codesandbox.io/s/1yzy7q474l as an example. We’d prefer to keep things simple, but you do bring up some valid thoughts. It’s possible that we can add a boolean property labeled useNative or something that when checked uses native styling after detecting the device. This adds a bit more complexity. I’ll have to bring this up internally and get back to you.

1 Like