Projets
Voir sur GitHub
bluzky/nice-select2
À propos
Une bibliothèque légère en JavaScript natif qui remplace les éléments select natifs par des listes déroulantes personnalisables.
Outils de développementProgression mesurée des étoiles
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- -1
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalNice Select
A lightweight Vanilla JavaScript plugin that replaces native select elements with customizable dropdowns.
Install
npm i nice-select2
Usage
Include nice-select2 script.
<script src="path/to/nice-select2.js"></script>
Include the styles, either the compiled CSS...
<link rel="stylesheet" href="path/to/nice-select2.css" />
Or import nice-select2 using ES6 syntax
import NiceSelect from "nice-select2";
@import "~nice-select2/dist/css/nice-select2.css";
// or
@import "~nice-select2/src/scss/nice-select2.scss";
Finally, initialize the plugin.
Using the minimified file directly:
NiceSelect.bind(document.getElementById("a-select"), {searchable: true, placeholder: 'select', searchtext: 'zoek', selectedtext: 'geselecteerd'});
Using as import in webpack:
new NiceSelect(document.getElementById("a-select"), {searchable: true});
Instance method
update(): update nice-select items to match with source selectfocus(): open dropdown list and focus on the search box if search is enableddisable(): disable selectenable(): enable selectdestroy(): destroy NiceSelect2 instanceclear(): clear all selected options
Full documentation and examples at https://bluzky.github.io/nice-select2/.
Explorer des projets similaires
Chargement…