my-radio

0.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i my-radio

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

10.2 kB

Total Files

7

Last publish

Collaborators

  • saahithyan