Code
Props
value
string
✅
id
string
✅
name
string
❌
label
string
✅
error
boolean
❌
disabled
boolean
❌
onChange
fuction event
❌
Event Response
id
string
name
string
label
string
value
string
onChange
Every time the user clicks on the Radio component, the onChange event is going to be executed together the custom function facilitated by the developer. Beside that, the developer can use the function event parameter to get information from the component, like if it was a native web checkbox.
Like in native input radios, to make them work properly it is necessary to write the same name in all the necessary Radio components. That way, it is going to avoid selecting more than one (Checkboxes intended function).
Components Dependency
For this component elaboration there were used the following internal components:
Live Demo
For detailed code usage documentation, see the Storybooks for each framework below.
React
Last updated