select2 README

The project's README from github.com/select2/select2. As one markdown file: README.md.

Select2

Build Status Financial Contributors on Open Collective jsdelivr cdnjs

Select2 is a jQuery-based replacement for select boxes. It supports searching, remote data sets, and pagination of results.

To get started, check out examples and documentation at https://select2.org/

Use cases

Browser compatibility

Usage

You can source Select2 directly from a CDN like jsDelivr or cdnjs, download it from this GitHub repo, or use one of the integrations below.

Integrations

Third party developers have created plugins for platforms which allow Select2 to be integrated more natively and quickly. For many platforms, additional plugins are not required because Select2 acts as a standard <select> box.

Plugins

Themes

Missing an integration? Modify this README and make a pull request back here to Select2 on GitHub.

Internationalization (i18n)

Select2 supports multiple languages by simply including the right language JS file (dist/js/i18n/it.js, dist/js/i18n/nl.js, etc.) after dist/js/select2.js.

Missing a language? Just copy src/js/select2/i18n/en.js, translate it, and make a pull request back to Select2 here on GitHub.

Documentation

The documentation for Select2 is available online at the documentation website and is maintained in the docs directory of this repository using MkDocs.

Community

You can find out about the different ways to get in touch with the Select2 community at the Select2 community page.

The license is available within the repository in the LICENSE file.

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

select2 (select2/select2)

Searching Database…

25.9K ·GitHub
What is this?Select2 is a jQuery-based replacement for standard HTML select boxes. It upgrades plain dropdowns with searching, remote data sets, and pagination of results.
What can it do that a plain HTML select box can't?Type-to-search, a better multi-select interface, options loaded via AJAX, optgroup nesting beyond one level, tagging new items on the fly, and custom result templates.
How do I add it to a project?Pull dist/js/select2.js and its CSS from a CDN like jsDelivr or cdnjs, download a release from GitHub, or use a framework integration plugin (Django, Rails, Drupal, Meteor and more).
Do I need jQuery to use it?Yes — Select2 is built as a jQuery plugin, so jQuery is the one hard requirement. Everything else runs client-side in the browser.
Will it work in older browsers?It supports very old browsers: IE 8+, Chrome 8+, Firefox 10+, Safari 3+ and Opera 10.6+. Modern evergreen browsers are covered.
Does it run in the browser or on a server?It runs entirely in the browser — it replaces select boxes in the page's DOM, with no server-side component.
Can it load options from the server as the user types?Yes — for large remote datasets Select2 can partially load data based on the current search term via AJAX, and it keeps loading more pages as you scroll to the end of the results.
Can users add options that aren't in the list yet?Yes — tagging lets people add brand-new options on the fly instead of choosing only from the predefined list.
Are there ready-made integrations for Django, Rails, or Bootstrap?Yes — community plugins exist for Django, Drupal, Meteor, Ruby on Rails, Wicket, Yii 2, AngularJS and Backdrop CMS, plus themes for Bootstrap 3, 4, 5 and Flat UI. On many platforms no plugin is needed at all.
Does it work in languages other than English?Yes — include the right language file from dist/js/i18n/ (like it.js or nl.js) after select2.js, and you can contribute missing languages by translating the English one.
Creator
select2
Size
14.1 MB
Stars
25.9K
Age
14y
Commits · 90 Days