Skip to content

saahithyan/my-radio

Repository files navigation

my-radio

A radio component for react

NPM JavaScript Style Guide

Install

npm install --save my-radio

Usage

import React, { Component } from 'react'

import MyRadio from 'my-radio'

class App extends Component {
    state = {
        items: [
            { txt: 'item 1', checked: false },
            { txt: 'item 2', checked: false },
            { txt: 'item 3', checked: true }
        ]
    }

    handler (refer, items) {
        this.setState({ items })
    }

    render () {
        const { items } = this.state

        return (
            <MyRadio
                refer='myRadio'
                heading='My Radio Buttons'
                handler={this.handler.bind(this)}
                items={items}
            />
        )
    }

}

export default App

License

MIT © saahithyan

About

A radio button component for react

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published