Skip to content

gradosevic/react-radiobox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

react-radiobox

RadioBox component for ReactJS

This is simple React radio box component that can be used instead of manually creating HTML radio box form inputs.

##Example:

<RadioBox
    selected={'2'}
    class={'custom-class'}
    group={'ordinal-numbers'}
    onChange={this.onChangeHanlder}
    items={{
        1: 'First', 
        2: 'Second',
        3: 'Third'
    }}
/>

##HTML output:

<table class="radiobox-group custom-class">
    <tbody>
        <tr>
            <td><input type="radio" id="ordinal-numbers_1" group="ordinal-numbers" name="ordinal-numbers" value="1" /></td>
            <td><label for="ordinal-numbers_1">First</label></td>
        </tr>
        <tr>
            <td><input type="radio" id="ordinal-numbers_2" group="ordinal-numbers" name="ordinal-numbers" value="2" checked /></td>
            <td><label for="ordinal-numbers_2">Second</label></td>
        </tr>
        <tr>
            <td><input type="radio" id="ordinal-numbers_3" group="ordinal-numbers" name="ordinal-numbers" value="3" /></td>
            <td><label for="ordinal-numbers_3">Third</label></td>
        </tr>
    </tbody>
</table>

##Demo JSFiddle demo

About

RadioBox component for ReactJS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published