npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

uxcore-select2

v0.5.10

Published

select ui component for react

Downloads

156

Readme


uxcore-select2 Dependency Status devDependency Status

TL;DR

uxcore-select2 ui component for react

setup develop environment

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

Usage

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 | - |