Skip to content

ClearC2/c2-react-picklist

Repository files navigation

c2-react-picklist CircleCI

A bootstrap v4 picklist react component. See demo.

Install

yarn add ClearC2/c2-react-picklist#^1.0.0

Usage

import React from 'react'
import Picklist from 'c2-react-picklist'

class App extends React.Component {
  state = {
    value: [],
    options: [
      {value: 'foo', label: 'Foo'},
      {value: 'bar', label: 'Bar'},
      {value: 'baz', label: 'Baz'}
    ]
  }
  render () {
    return (
      <Picklist
        options={this.state.options}
        value={this.state.value}
        onChange={(value) => this.setState({value})}
      />
    )
  }
}