0.1.0 • Published 4 years ago

my-radio v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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