rimble-ui
rimble-ui copied to clipboard
Add validation for Checkbox and Radio inputs
Is your feature request related to a problem? Please describe. When a Checkbox or Radio is set to required, then validated, there is no indication that the fields are invalid.
Describe the solution you'd like Add a border around the Checkbox or Radio input that shows green/red for valid/invalid input.
Describe alternatives you've considered Could manually re-create the effect.
Additional context This was requested by a Rimble user during the gitcoin hackathon. The Form example does not show how to use Checkbox or Radio, and when added they do not change when invalid/valid.
There is code in the Form that implies support for Checkbox: https://github.com/ConsenSys/rimble-ui/blob/master/src/Form/index.js
Form.Check
Example implementation of Form with different input elements: https://codesandbox.io/embed/vvalidated-form-with-select-k8owh
Can we provide some example implementations of Checkbox/Radio validation? @MikeLockz
@gesquinca - do you mean adding something like the codesandbox to docs? Or just writing up examples to develop against?
https://codesandbox.io/embed/vvalidated-form-with-select-k8owh
I would expect to see highlighting around the field containing radio elements or checkboxes when the "validation" checkbox is toggled, just like there is highlighting around Input and Select components. Use case for this would be accepting T&Cs checkbox before allowing user to continue.