Search by

jjj / chosen

jjj

Chosen enhances native select boxes with jQuery and Prototype adapters, plus experimental Vanilla and React editions.

Package info

github.com/JJJ/chosen

Homepage

Language:CoffeeScript

Type:npm-asset

pkg:composer/jjj/chosen

Statistics

Installs: 661 290

Dependents: 2

Suggesters: 0

Stars: 29

Open Issues: 0


README

Chosen makes long, unwieldy select boxes easier to use. This is the actively maintained fork of Harvest's original Chosen. The original project merged more than 300 pull requests, and this fork carries that work forward with new fixes, integrations, and editions. The Harvest issue review records which remaining upstream reports are covered, fixed, or out of scope.

Use the edition that fits your application:

Edition Package entry Status
jQuery chosen-jjj or chosen-jjj/jquery Classic, default entry
Prototype chosen-jjj/prototype Classic
Vanilla JavaScript chosen-jjj/native Experimental, no framework dependency
React chosen-jjj/react Experimental, React 18+ peer dependency

The classic and Vanilla editions enhance an existing <select>, which remains the source of form values. React supplies its own component and form integration. Both newer editions cover the listed classic options. Here, experimental means their API and generated markup are still settling, and they are not yet drop-in replacements for the classic adapters. For example, Tab on an open single select differs. See the adapter parity inventory for the current behavior.

  • jQuery support: 1.7+ (tested with 1.7, 1.12, 3.5, and 4.0)
  • Prototype support: 1.7+ (tested with 1.7)

Chosen's original compatibility target included Chrome, Firefox, Safari, and Internet Explorer 9. The full classic adapter browser suite runs in Chrome, and a focused Firefox test covers scrolled single-select Tab navigation in both adapters. The Vanilla, React, and touch suites also run in WebKit. Safari and Internet Explorer 9 are not currently covered by this fork's automated desktop tests. Please include your browser and library versions when reporting a compatibility issue.

For documentation, usage, and examples, see the jQuery demo, Prototype demo, vanilla demo, and React demo, plus the options reference. The wiki covers setup and common workflows. Applications updating from 3.x should read the 4.0 migration guide.

For downloads, see the GitHub releases.

Compiled Assets

The compiled JavaScript and CSS files are located in the /dist directory. This directory contains:

  • chosen.jquery.js / chosen.jquery.min.js - jQuery version
  • chosen.proto.js / chosen.proto.min.js - Prototype version
  • chosen.css / chosen.min.css - Styles
  • chosen.css.map - CSS source map
  • native/chosen.native.js / native/chosen.css - experimental vanilla edition
  • react/index.mjs / react/chosen.css - experimental React edition
  • remote/chosen.remote.js - opt-in bounded remote source helper for browser integrations

The /docs directory also contains copies of these files for GitHub Pages. GitHub Pages publishes it automatically when changes reach master. Each release includes both a full archive and a compiled distribution archive.

Package managers

To install with npm:

npm install chosen-jjj

The default package entry loads the jQuery adapter through browser globals, AMD, or CommonJS. CommonJS consumers should install jQuery alongside Chosen and provide a DOM before requiring the packages. Explicit entries for the Prototype adapter, shared CSS, Sass, and the experimental framework-neutral ESM/CommonJS core are described in the package boundaries. The experimental editions have a Vanilla guide and a React guide. For large server-backed lists, see the opt-in remote source guide.

To install with Composer:

composer require jjj/chosen

Contributing to this project

Contributions are welcome. Please follow the contributing guidelines so maintainers can review your work efficiently.

Before opening an issue, see support and discussion routes. Please follow our Code of Conduct. For a potential security issue, use the private reporting instructions instead of a public issue.

Chosen Credits