canvas-kit
canvas-kit copied to clipboard
Switch Component Improvements
🚀 Feature Proposal
After doing a thorough test re-write (#386) of Switch, there are some improvements we can make to this component.
- I don't think we need to specify tabIndex={0}, this is the default already.
- We should map a static member Switch.ErrorType.Alert to ErrorType from canvas-kit-react-common. It's kind of a pain to import that also just to use Switch.
- Per some conversations that @NicholasBoll had with a11y in the past, we should probably make the role attribute a configurable prop. Instead of checkbox it could be something like switch.
- We should probably rename the elements SwitchBackground and SwitchCircle to something more semantically correct like SwitchTrack and SwitchThumb.
Motivation
Our components can always be a bit better 🌞