2.0.1 • Published 3 years ago

kodobe-react-radio v2.0.1

Weekly downloads
5
License
ISC
Repository
-
Last release
3 years ago

Kodobe React Radio

This is a simple react radio and radio group package.

Install

npm install kodobe-react-radio

or

yarn add kodobe-react-radio

Setup

import Radio from 'kodobe-react-radio'; import Radio, {RadioGroup} from 'kodobe-react-radio';

Usage

import Radio, {RadioGroup} from "kodobe-react-radio";

function App() {
    return (
        <div>
            <h3>Here is how to use a radio</h3>
            <Radio isChecked={radio} onCheck={(t) => setRadio(t.target.value)} />


            <h3>Here is how to use a radio group</h3>
            <RadioGroup
                className="rgroup"
                value={female}
                name="gender"
                onChange={(v) => console.log(v.target.value)}
            >
                <Radio value="female" />
                <Radio value="male" />
                <Radio value="twice" />
                <Radio value="king" />
            </RadioGroup>
        </div>
    );
}

Options

Radio

  • isChecked : state of the radio (boolean, default=false)
  • disabled : if the switch can be toggled (boolean, default=false)
  • onCheck : check a radio button (function, required)
  • style : (object)
  • className : (string)
  • id : (any)
  • name : (string)

Radio Group

  • value : value corresponding to one of the radio child (any, default="")
  • children : list of Radio Components (obj, required)
  • onChange : change radio value (function, required)
  • style : (object)
  • className : (string)
  • id : (any)
  • name : (string)
2.0.1

3 years ago

2.0.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago