| 1 |
Select2 |
| 2 |
======= |
| 3 |
[![Build Status][travis-ci-image]][travis-ci-status] |
| 4 |
|
| 5 |
Select2 is a jQuery-based replacement for select boxes. It supports searching, |
| 6 |
remote data sets, and pagination of results. |
| 7 |
|
| 8 |
To get started, checkout examples and documentation at |
| 9 |
https://select2.org/ |
| 10 |
|
| 11 |
Use cases |
| 12 |
--------- |
| 13 |
* Enhancing native selects with search. |
| 14 |
* Enhancing native selects with a better multi-select interface. |
| 15 |
* Loading data from JavaScript: easily load items via AJAX and have them |
| 16 |
searchable. |
| 17 |
* Nesting optgroups: native selects only support one level of nesting. Select2 |
| 18 |
does not have this restriction. |
| 19 |
* Tagging: ability to add new items on the fly. |
| 20 |
* Working with large, remote datasets: ability to partially load a dataset based |
| 21 |
on the search term. |
| 22 |
* Paging of large datasets: easy support for loading more pages when the results |
| 23 |
are scrolled to the end. |
| 24 |
* Templating: support for custom rendering of results and selections. |
| 25 |
|
| 26 |
Browser compatibility |
| 27 |
--------------------- |
| 28 |
* IE 8+ |
| 29 |
* Chrome 8+ |
| 30 |
* Firefox 10+ |
| 31 |
* Safari 3+ |
| 32 |
* Opera 10.6+ |
| 33 |
|
| 34 |
Select2 is automatically tested on the following browsers. |
| 35 |
|
| 36 |
[![Sauce Labs Test Status][saucelabs-matrix]][saucelabs-status] |
| 37 |
|
| 38 |
Usage |
| 39 |
----- |
| 40 |
You can source Select2 directly from a CDN like [JSDliver][jsdelivr] or |
| 41 |
[CDNJS][cdnjs], [download it from this GitHub repo][releases], or use one of |
| 42 |
the integrations below. |
| 43 |
|
| 44 |
Integrations |
| 45 |
------------ |
| 46 |
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. |
| 47 |
|
| 48 |
Plugins |
| 49 |
|
| 50 |
* [Django] |
| 51 |
- [django-autocomplete-light] |
| 52 |
- [django-easy-select2] |
| 53 |
- [django-select2] |
| 54 |
* [Meteor] - [meteor-select2] |
| 55 |
* [Ruby on Rails][ruby-on-rails] - [select2-rails] |
| 56 |
* [Wicket] - [wicketstuff-select2] |
| 57 |
* [Yii 2][yii2] - [yii2-widget-select2] |
| 58 |
|
| 59 |
Themes |
| 60 |
|
| 61 |
- [Bootstrap 3][bootstrap3] - [select2-bootstrap-theme] |
| 62 |
- [Flat UI][flat-ui] - [select2-flat-theme] |
| 63 |
- [Metro UI][metro-ui] - [select2-metro] |
| 64 |
|
| 65 |
Missing an integration? Modify this `README` and make a pull request back here to Select2 on GitHub. |
| 66 |
|
| 67 |
Internationalization (i18n) |
| 68 |
--------------------------- |
| 69 |
Select2 supports multiple languages by simply including the right language JS |
| 70 |
file (`dist/js/i18n/it.js`, `dist/js/i18n/nl.js`, etc.) after |
| 71 |
`dist/js/select2.js`. |
| 72 |
|
| 73 |
Missing a language? Just copy `src/js/select2/i18n/en.js`, translate it, and |
| 74 |
make a pull request back to Select2 here on GitHub. |
| 75 |
|
| 76 |
Documentation |
| 77 |
------------- |
| 78 |
The documentation for Select2 is available |
| 79 |
[through GitHub Pages][documentation] and is located within this repository |
| 80 |
in the [`docs` folder][documentation-folder]. |
| 81 |
|
| 82 |
Community |
| 83 |
--------- |
| 84 |
You can find out about the different ways to get in touch with the Select2 |
| 85 |
community at the [Select2 community page][community]. |
| 86 |
|
| 87 |
Copyright and license |
| 88 |
--------------------- |
| 89 |
The license is available within the repository in the [LICENSE][license] file. |
| 90 |
|
| 91 |
[cdnjs]: http://www.cdnjs.com/libraries/select2 |
| 92 |
[community]: https://select2.org/getting-help |
| 93 |
[documentation]: https://select2.org |
| 94 |
[documentation-folder]: https://github.com/select2/select2/tree/master/docs |
| 95 |
[freenode]: https://freenode.net/ |
| 96 |
[jsdelivr]: http://www.jsdelivr.com/#!select2 |
| 97 |
[license]: LICENSE.md |
| 98 |
[releases]: https://github.com/select2/select2/releases |
| 99 |
[saucelabs-matrix]: https://saucelabs.com/browser-matrix/select2.svg |
| 100 |
[saucelabs-status]: https://saucelabs.com/u/select2 |
| 101 |
[travis-ci-image]: https://img.shields.io/travis/select2/select2/master.svg |
| 102 |
[travis-ci-status]: https://travis-ci.org/select2/select2 |
| 103 |
|
| 104 |
[bootstrap3]: https://getbootstrap.com/ |
| 105 |
[django]: https://www.djangoproject.com/ |
| 106 |
[django-autocomplete-light]: https://github.com/yourlabs/django-autocomplete-light |
| 107 |
[django-easy-select2]: https://github.com/asyncee/django-easy-select2 |
| 108 |
[django-select2]: https://github.com/applegrew/django-select2 |
| 109 |
[flat-ui]: http://designmodo.github.io/Flat-UI/ |
| 110 |
[meteor]: https://www.meteor.com/ |
| 111 |
[meteor-select2]: https://github.com/nate-strauser/meteor-select2 |
| 112 |
[metro-ui]: http://metroui.org.ua/ |
| 113 |
[select2-metro]: http://metroui.org.ua/select2.html |
| 114 |
[ruby-on-rails]: http://rubyonrails.org/ |
| 115 |
[select2-bootstrap-theme]: https://github.com/select2/select2-bootstrap-theme |
| 116 |
[select2-flat-theme]: https://github.com/techhysahil/select2-Flat_Theme |
| 117 |
[select2-rails]: https://github.com/argerim/select2-rails |
| 118 |
[vue.js]: http://vuejs.org/ |
| 119 |
[select2-vue]: http://vuejs.org/examples/select2.html |
| 120 |
[wicket]: https://wicket.apache.org/ |
| 121 |
[wicketstuff-select2]: https://github.com/wicketstuff/core/tree/master/select2-parent |
| 122 |
[yii2]: http://www.yiiframework.com/ |
| 123 |
[yii2-widget-select2]: https://github.com/kartik-v/yii2-widget-select2 |
| 124 |
|