2.0.1 • Published 8 years ago
@hnordt/reax-select v2.0.1
Reax Select
Bootstrap Select component for React
PropTypes
{
name: PropTypes.string,
options: PropTypes.arrayOf(PropTypes.shape({
label: PropTypes.string.isRequired,
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
]).isRequired,
disabled: PropTypes.bool
})).isRequired,
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
]),
multiple: PropTypes.bool,
autoFocus: PropTypes.bool,
disabled: PropTypes.bool,
onFocus: PropTypes.func,
onChange: PropTypes.func,
onBlur: PropTypes.func
}
Usage
npm install --save @hnordt/reax-select
import React from 'react';
import Select from '@hnordt/reax-select';
const Foo = () => (
<Select options={[
{
label: 'Foo',
value: 'foo'
},
{
label: 'Bar',
value: 'bar',
disabled: true
},
{
label: 'Foo Bar',
value: 'foo-bar'
}
]} value="foo-bar" onChange={event => console.log(event.target.value)} />
);
export default Foo;