Radio
A radio button component.
Usage
import React from 'react'
import { Radio } from '@aragon/ui'
class App extends React.Component {
state = { checked: false }
render() {
return (
<div>
<label>
<Radio
id="strawberry"
checked={this.state.checked}
onChange={id => {
console.log(
`${singleChecked ? 'Unchecked' : 'Checked'} ${id}`
)
this.setState({ singleChecked: !singleChecked })
}}
/>
Click me
</label>
</div>
)
}
}Demonstration

Props
checked
checkedType:
BooleanDefault:
false
Whether it is checked or not.
disabled
disabledType:
BooleanDefault:
false
Set to true to disable the radio.
id
idType:
StringorNumber
When the <Radio /> is nested in a <RadioGroup />, this value is passed to the <RadioGroup />'s onChange handler when the radio is checked.
If not, it is passed to the onCheck handler when the radio is checked.
onChange
onChangeType:
Function:(id: String|Number) -> *
This callback is called whenever the user selects the radio.
Arguments:
id: The value passed as theidprop.
Last updated
Was this helpful?
