# uxcore-select2

> select ui component for react

Latest version **0.5.10** (published 2019-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install uxcore-select2
pnpm add uxcore-select2
yarn add uxcore-select2
bun add uxcore-select2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.10 |
| Published | 2019-12-17 |
| First published | 2015-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 57.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | eternalsky, ex90rts, gbk, surfacew, taoqili, vincent.bian |
| Keywords | react, react-pagination, react-select, select |

## Links

- npm: https://www.npmjs.com/package/uxcore-select2
- Repository: https://github.com/uxcore/uxcore-select2
- Homepage: https://github.com/uxcore/uxcore-select2#readme
- Issues: http://github.com/uxcore/select/issues
- npm.io page: https://npm.io/package/uxcore-select2

## Dependencies (3)

- [rc-select](https://npm.io/package/rc-select.md) ~8.1.0
- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.5.10 (latest) — 2019-12-17
- 0.5.9 — 2019-12-16
- 0.5.8 — 2019-12-16
- 0.5.8-beta2 — 2019-12-16
- 0.5.8-beta.1 — 2019-12-16
- 0.5.7 — 2019-03-14
- 0.5.6 — 2019-01-05
- 0.4.26 — 2018-11-08
- 0.5.5 — 2018-10-08
- 0.5.4 — 2018-09-11
- 0.5.3 — 2018-09-11
- 0.5.2 — 2018-09-11
- 0.5.1 — 2018-08-10
- 0.5.0 — 2018-06-12
- 0.4.25 — 2018-05-24
- … 56 more at https://npm.io/package/uxcore-select2/versions

## README

---

## uxcore-select2 [![Dependency Status](http://img.shields.io/david/uxcore/uxcore-select2.svg?style=flat-square)](https://david-dm.org/uxcore/uxcore-select2) [![devDependency Status](http://img.shields.io/david/dev/uxcore/uxcore-select2.svg?style=flat-square)](https://david-dm.org/uxcore/uxcore-select2#info=devDependencies) 

## TL;DR

uxcore-select2 ui component for react

#### setup develop environment

```sh
$ git clone https://github.com/uxcore/uxcore-select2
$ cd uxcore-select2
$ npm install
$ npm start
```

## Usage

```javascript
var Select = require('uxcore-select2');
<Select>
  <Option value="lucy">lucy</Option>
</Select>
```

### demo
http://uxcore.github.io/select/

## Props

### Select props

|参数|说明|类型|默认值|
|---|----|---|------|
|value | 指定当前选中的条目 | string/Array | 无 |
|defaultValue | 指定默认选中的条目 | string/Array | 无 |
|multiple | 支持多选 | bool  | false |
|filterOption | 是否根据输入结果过滤选项，默认是使用 optionFilterProp 对应的 Option 属性来过滤  | bool/function(inputValue, Option) | true |
|showSearch | 是否在单选模式下显示搜索 | bool | true |
|tags | 可以把随意输入的条目作为tag，输入项不需要与下拉选项匹配 | bool | false |
|onSelect | 被选中时调用，参数为选中的option value值 | function(value, option:Option) | 无 |
|onDeselect | 取消选中时调用，参数为选中的option value值，仅在multiple或tags模式下生效 | function(value) | 无 |
|onChange | 选中option，或input的value变化(combobox模式下)时，调用此函数 | function | 无 |
|onSearch | 搜索框值发生变化时调用 | function(key) | noop |
|allowClear | 显示清除按钮 |  | false |
|placeholder | 选择框默认文字 | string | 无 |
|searchPlaceholder | 搜索框默认文字 | string | 无 |
|optionFilterProp | 输入项过滤对应的 option 属性 | string | value |
|combobox | 输入框自动提示模式 | bool | false |
|optionLabelProp| 选择 Option 的哪个 prop 作为选择框中的显示。| string | 'children' |
|getPopupContainer| 弹出的菜单渲染在哪个容器中 | function(trigger:Node):Node | function(){return document.body;}|
|dropdownMatchSelectWidth|dropdown 部分是否和 select 部分同宽| boolean | true |
|dropdownClassName | dropdown 部分的定制类名 | string | - |
|notFoundContent   | 未找到选项时的提示文案   | string | not found |
|size | 尺寸，枚举值 `large`, `small`, `middle` | string | large |


### Option props
|参数|说明|类型|默认值|
|---|----|---|------|
|disabled | 是否禁用 | Boolean | false |
|key | 如果react需要你设置此项，此项值与value的值相同，然后可以省略value设置 | String | |
|value | 默认根据此属性值进行筛选 | String | - |
|title | 如果你不满意自动生成的 title，你可以用这个 prop 来修改 | String | - |

### OptGroup props
|参数|说明|类型|默认值|
|---|----|---|------|
|label | 组名 | String/React.Element | 无 |
|key |  | String | - |

---
_Source: https://npm.io/package/uxcore-select2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
