0.0.2 • Published 8 years ago

react-as-select v0.0.2

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

react-as-select

Test coverage Build Status Dependency Status devDependency Status NPM version node License npm download

A React select

Demo

Demo here

Installation

$ npm install --save react-as-select

Usage

Easy select

import Select from 'react-as-select';
const {
  Option,
  Group
} = Select;

<Select onChange={this._handleChange('select1')} placeholder="Please select" value={this.state.select1} >
  <Option value="html">HTML</Option>
  <Option disabled value="javascript">JavaScript</Option>
  <Option value="css">CSS</Option>
</Select>

Group Select

import Select from 'react-as-select';
const {
  Option,
  Group
} = Select;

<Select onChange={this._handleChange('select2')} placeholder="Please select" value={this.state.select2} >
  <Option value="html">HTML</Option>
  <Option disabled value="javascript">JavaScript</Option>
  <Option value="css">CSS</Option>
  <Group title="Language">
    <Option value="english">English</Option>
    <Option disabled value="france">France</Option>
    <Option value="chinese">Chinese</Option>
  </Group>
  <Group title="Country">
    <Option disabled value="china">China</Option>
    <Option disabled value="usa">USA</Option>
    <Option value="us">US</Option>
  </Group>
</Select>

Properties

Select

NameDescriptionTypeRequiredDefault Value
childrenNodenull
classNameString'react-as-select'
defaultValueString
disabledBooleanfalse
maxHeightNumber200
nameString
onChangeFunction() => {}
placeholderAny''
readOnlyBooleanfalse
valueString

Option

NameDescriptionTypeRequiredDefault Value
childrenString
valueString

Group

NameDescriptionTypeRequiredDefault Value
titleString''

Development

Online test page here

$ npm run dev # startup local dev server
$ npm run build # build
$ npm run test # run tests
$ npm run cov # run coverage
$ npm run build-demo # build demo, auto run in 'npm run build'

License

The MIT License (MIT)

Copyright (c) 2015 ly-components

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.