ts

ts-select2

TsSelect2 is a version of Select2 written in typescript without any dependencies. It supports searching, remote data sets, and infinite scrolling of results.

Showing:

Popularity

Downloads/wk

62

GitHub Stars

15

Maintenance

Last Commit

2mos ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

21.6KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Description

TsSelect2 is a version of Select2 written in typescript without any dependencies. It supports searching, remote data sets, and infinite scrolling of results. Use the TsSelect2 library for development only, not production for now.

Installation - NPM

npm i ts-select2

Installation - Browser

<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://unpkg.com/ts-select2@0.1.0/dist/ts-select2.min.js"></script>

Usage

Add the following libraries to the page:

  • ts-select2.min.js

Add the following stylesheets from Select2 to the page:

  • select2.min.css

Initialisation

<select data-placeholder="Select something" multiple="multiple" class="form-control select-access-multiple-enable">
    <option value="AK">Alaska</option>
    <option value="CA">California</option>
    <option value="AZ" selected>Arizona</option>
    <option value="CO">Colorado</option>
    <option value="ID">Idaho</option>
    <option value="WY" selected>Wyoming</option>
    <option value="CT">Connecticut</option>
</select>

Example

To initialise the select, call TsSelect2 on the element:

const select2 = new TsSelect2(select, {  minimumResultsForSearch: Infinity,  width: `250px` });

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100