RadioGroup
Wrap a group of Radio Buttons to automatically control their selection
(code example)
Usageβ
Live Editor
function Example(props) { const [currentValue, setCurrentValue] = useState('yes'); return ( <div> <RadioGroup initialValue={currentValue} onValueChange={setCurrentValue}> <RadioButton value={'yes'} label={'Yes'}/> <RadioButton marginT-10 value={'no'} label={'No'}/> </RadioGroup> </div> ); }
Result
Loading...
APIβ
initialValueβ
The initial value of the selected radio button
string | number | boolean
onValueChangeβ
Invoked once when value changes, by selecting one of the radio buttons in the group
((value?: string) => void) | ((value?: number) => void) | ((value?: boolean) => void) | ((value?: any) => void)