Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

slim_select

65 sites Security covered
View on drupal.org

Integrates Slim Select with the select form element, converting it into a Slim Select HTML element. Allows users to add classes to the select options and perform search on them.

Homepage: www.drupal.org/project/slim_select
External library homepage: slimselectjs.com
Bugs and improvements: www.drupal.org/project/issues/slim_select

INSTALLATION

Preferred method: Slim Select is providing a package.json that can include the slim-select library. Make sure you have NPM of nodejs installed in your system and from the module folder, run npm install.
Alternatively, in your composer add the following script in your post-install-cmd scripts in order to install the dependencies with each composer install.

{
  "scripts": {
    "post-install-cmd": [
      "npm install -C web/modules/contrib/slim_select"
    ]
  }
}

In the script above, it is assumed that the slim_select module is installed in the web/modules/contrib directory as a relative path from the project root or where your composer.json is located. Adapt the path according to your installation.

Alternative methods:
Manually download and install the library in the libraries folder in the webroot, profile directory or site directory within drupal. The package should be placed as such, so that the path looks like <libraries path>/slim-select/dist/slimselect.min.js where <libraries path> is one of the directories mentioned above.

USAGE

In order to override the normal select element and display a Slim Select version, simply add a #slim_select property to the existing form element like below.

$form['my_slim_select'] = [
  '#type' => 'select'
  '#title' => 'A new select',
  '#options' => [
    'option1' => 'Red',
    'option2' => 'Green',
    'option3' => 'Blue',
  ],
  '#slim_select' => [
    'showSearch' => TRUE,
  ],
];

The #slim_select entry holds the configurable options of the Slim Select library. There are two configurable options currently supported as well.

  • showSearch: Controls whether there will be a search bar for looking up options in the select.
  • selectByGroup: When the select element accepts multiple options, if there are options grouped by an optgroup, then the optgroup becomes clickable, and clicking it selects automatically all children options.

Activity

Total releases
3
First release
Feb 2025
Latest release
10 months ago
Release cadence
52 days
Stability
0% stable

Release Timeline

Releases

Version Type Release date
1.0.0-beta2 Pre-release May 20, 2025
1.0.0-beta1 Pre-release Apr 4, 2025
1.0.0-alpha5 Pre-release Feb 6, 2025