Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Chosen

43,579 sites Security covered Drupal 10–11
View on drupal.org

This module enhances HTML select elements by applying the Chosen JavaScript library, making them more user-friendly, especially those with many options. It can automatically apply this enhancement or be configured for specific elements and fields. Newer versions also offer improved compatibility and mobile support.

Chosen uses the Chosen javascript library to make your <select> elements more user-friendly.

Usage

By default the module will automatically apply itself to any select elements that have more than 20 options, which is a reasonable default for which having Chosen will be useful. To change or disable this automatic enhancement, you can change the selectors (or remove all selectors) from the Apply Chosen to the following elements field on the Chosen administration page.

The version 5.x uses the noli42/chosen fork of the library, which removes the jQuery dependency, and provides the ability to enable Chosen for mobile devices.
The version 4.x uses the jjj/chosen fork of the library.
The version 3.x uses the original but now abandoned harvesthq/chosen library.

Installation via Composer for Drupal 10-11

If you are using Composer to manage your site's dependencies, then follow the instructions depending on your module version:
For version 5.x:
The README contains all the information for the setup.
For version 4.x:
The README contains all the information for the setup.
For version 3.x:
issue #3102250 comment #47.

Update with Composer for Drupal 10-11

composer require drupal/chosen:[version] -W

for example:
composer require drupal/chosen:5.0.5 -W

Installation via Drush

A Drush command is provided in the latest versions for easy installation of the Chosen plugin.

drush chosenplugin

The command will download the plugin and unpack it in the right folder.
It is possible to add another path as an option to the command, but not
recommended unless you know what you are doing.

Dependencies

The Drupal 10-11 version has no Drupal dependencies.

FAPI #chosen property

For developers, you can force the Chosen plugin to be applied or never applied to your select FAPI element by adding $element['#chosen'] = TRUE; or $element['#chosen'] = FALSE; respectively.

Field UI

You can force enable/disable Chosen for certain field widgets: Select list (for both list and date fields), and Select (or other) list. If you have a field using one of these widgets, in the field settings, you will find a Apply Chosen to the select fields in this widget? option with three values: Apply, Do not apply, or No preference (which will fall back to using the automatic application).

Supporting this module

If this module is useful to you, consider supporting its maintenance through
GitHub Sponsors.

Depends on

Dependencies of the latest stable release

Required by

5 tracked projects depend on this one

Activity

Tracked releases
9
Tracked since
Sep 2024
Latest release
3 weeks ago
Releases (12 mo)
5 ▲ from 4
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
5.0.7 Stable 10–11 Aug 5, 2026
5.0.6 Stable 10–11 May 24, 2026
5.0.5 Stable 10–11 Apr 29, 2026
5.0.4 Stable 10–11 Mar 29, 2026
5.0.3 Stable 10–11 Jan 3, 2026
5.0.2 Stable 10–11 May 3, 2025
5.0.1 Stable 10–11 Mar 1, 2025
5.0.0 Stable 9–11 Jan 27, 2025
5.0.0-rc1 Pre-release 9–11 Sep 26, 2024