Skip to content

rlesniak/react-basic-dropdown

Repository files navigation

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

About

A very basic and perspective dropdown

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •