Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chenglou/react-chosen

React wrapper for Chosen jQuery.
https://github.com/chenglou/react-chosen

Last synced: about 2 months ago
JSON representation

React wrapper for Chosen jQuery.

Awesome Lists containing this project

README

        

# React-chosen

#### This project has been deprecated. Please use [React-select](https://github.com/JedWatson/react-select), a pure React-based solution, instead. Thanks!

[React](http://facebook.github.io/react/) wrapper for [Chosen](http://harvesthq.github.io/chosen/) jQuery.

## install

```sh
bower install react-chosen
```

Or simply drop the script somewhere on your page (after React and Chosen of course):

```html

```

The npm build works, but unfortunately not well:

```sh
npm install react-chosen
```

Due to the awkwardness of Chosen and jQuery on npm, you'll still have to include jQuery as a global dependency. Installing via npm is not recommended.

## API

Please refer to [Chosen](http://harvesthq.github.io/chosen/)'s API. It's pretty much the same, except:

- Every Chosen option employs camelCase, e.g. disable_search_threshold -> disableSearchThreshold.

- Just like React's [controlled component](http://facebook.github.io/react/docs/forms.html#controlled-components), `value` controls your select and makes it immune to changes unless you specify so.

## Example

```html
/** @jsx React.DOM */
React.renderComponent(

Facebook
Harvest

, document.body);

// or multi-select
React.renderComponent(

Apple
Facebook
Harvest

, document.body);
```

## License

MIT.