Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/chenglou/react-chosen
- Owner: chenglou
- Created: 2013-07-09T05:34:59.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-04-10T14:36:53.000Z (over 5 years ago)
- Last Synced: 2024-04-27T17:45:38.580Z (9 months ago)
- Language: HTML
- Size: 96.7 KB
- Stars: 96
- Watchers: 5
- Forks: 25
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
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(
Harvest
, document.body);// or multi-select
React.renderComponent(
Apple
Harvest
, document.body);
```## License
MIT.