react-chosen

WebJar for react-chosen

License

License

MIT
Categories

Categories

React User Interface Web Frameworks
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

react-chosen
Last Version

Last Version

0.3.8
Release Date

Release Date

Type

Type

jar
Description

Description

react-chosen
WebJar for react-chosen
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

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

Download react-chosen

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/react-chosen/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>react-chosen</artifactId>
    <version>0.3.8</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/react-chosen/
implementation 'org.webjars.npm:react-chosen:0.3.8'
// https://jarcasting.com/artifacts/org.webjars.npm/react-chosen/
implementation ("org.webjars.npm:react-chosen:0.3.8")
'org.webjars.npm:react-chosen:jar:0.3.8'
<dependency org="org.webjars.npm" name="react-chosen" rev="0.3.8">
  <artifact name="react-chosen" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='react-chosen', version='0.3.8')
)
libraryDependencies += "org.webjars.npm" % "react-chosen" % "0.3.8"
[org.webjars.npm/react-chosen "0.3.8"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm » drmonty-chosen jar [1.4.2,1.5)
org.webjars.npm : jquery jar [2.1.1,3)
org.webjars.npm : react jar [0.13.0,0.14)

Project Modules

There are no modules declared in this project.

React-chosen

This project has been deprecated. Please use React-select, a pure React-based solution, instead. Thanks!

React wrapper for Chosen jQuery.

install

bower install react-chosen

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

<script src="path/to/react-chosen.js"></script>

The npm build works, but unfortunately not well:

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'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, value controls your select and makes it immune to changes unless you specify so.

Example

/** @jsx React.DOM */
React.renderComponent(
  <Chosen noResultsText="No result" value="Harvest" onChange={doSomething}>
    <option value="Facebook">Facebook</option>
    <option value="Harvest">Harvest</option>
  </Chosen>
, document.body);

// or multi-select
React.renderComponent(
  <Chosen defaultValue={["Apple"]} width="92px" data-placeholder="Select..." multiple>
    <option value="Apple">Apple</option>
    <option value="Facebook">Facebook</option>
    <option value="Harvest">Harvest</option>
  </Chosen>
, document.body);

License

MIT.

Versions

Version
0.3.8