1.0.0 • Published 8 years ago

nd-rc-checkbox v1.0.0

Weekly downloads
10
License
MIT
Repository
github
Last release
8 years ago

react-checkbox

Build Status Coverage Status npm bitHound Dev Dependencies bitHound Dev Dependencies bitHound Code bitHound Dev Dependencies bitHound Overall Score

React UI Component - checkbox

Install

$ npm install nd-rc-checkbox --save

Use

import React from 'react'
import Checkbox from 'nd-rc-checkbox'
import 'nd-rc-checkbox/assets/index.scss'

export default class extends React.Component {

  handleChange (value, e) {
    // [Object]: the event object
    console.log(e)
    // [Boolean]: true as checked, false as not
    console.log(value)
  }

  render () {
    // [Boolean]: default checked
    const checked = true
    // [Boolean]: disabled, true as disabled, false as not
    const disable = true
    // [String]: type, 'square' or 'circle', 'square' as default
    const type = 'circle'

    return (
      <div>
        <Checkbox disable={disable} onChange={this.handleChange}/>
        <Checkbox checked={checked} type={type} onChange={this.handleChange}/>
      </div>
    )
  }
}
1.0.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago