0.1.2 • Published 7 years ago

react-basic-dropdown v0.1.2

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

React Basic Dropdown

Build Status npm version

The minimal and simple React dropdown.

Installation

yarn add react-basic-dropdown

or

npm install react-basic-dropdown --save

Basic Usage

import Select from 'react-basic-dropdown'
// to have default stylesheets. Optional
import 'react-basic-dropdown/dist/styles.css'

class Example extends Component {
  handleValueChange(option) {
    console.log('change', option)
  }

  render() {
    const options = [
      { label: 'Option 1', value: 1 },
      { label: 'Another option', value: 2 },
    ]

    return (
      <Select
        value={2}
        options={options}
        onChange={this.handleValueChange}
      />
    )
  }
}

TODO:

  • This readme
  • More configuration options