Repository URL to install this package:
|
Version:
8.1.0-rc.5 ▾
|
Custom Radio Buttons controlled:
const StateContainer = () => { let state; const setState = (value) => state = value; return ( <CustomRadioButtons title="Some label for radio buttons" options={['1', '10', '100', '200', '2500']} selected={state} onChange={(value) => { setState(value); }} name="radioButtons1" /> ); }; <StateContainer />
Custom Radio Buttons all options unchecked:
<CustomRadioButtons title="Some label for radio buttons" options={['2', '20', '200', '400', '4500']} selected={'not part of options'} onChange={() => { console.log('Custom radio buttons onChange triggered'); }} name="radioButtons2" />
Custom Radio Buttons uncontrolled with longer text options:
<CustomRadioButtons title="Some label for radio buttons" options={['Saturday and Sunday', 'Monday to Friday', 'Every day']} onChange={() => { console.log('Custom radio buttons onChange triggered'); }} name="radioButtons3" />