Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/components / controls / CustomRadioButtons / CustomRadioButtons.md
Size: Mime:

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"
/>