• Stars
    star
    357
  • Rank 118,830 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 5 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A lightweight vanilla javascript library that replaces native select elements with customizable dropdowns

Nice 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 select
  • focus(): open dropdown list and focus on the search box if search is enabled
  • disable(): disable select
  • enable(): enable select
  • destroy(): destroy NiceSelect2 instance
  • clear(): clear all selected options

Full documentation and examples at https://bluzky.github.io/nice-select2/.

More Repositories

1

salad_ui

Phoenix Liveview component library inspired by shadcn UI
Elixir
368
star
2

tarams

Cast and validate external data and request parameters for Elixir and Phoenix
Elixir
110
star
3

orangecms

Admin interface for your static site
Elixir
60
star
4

salad_storybook

Phoenix liveview components inspired by shadui
Elixir
41
star
5

json_view

Elixir library to render Json with relationship
Elixir
30
star
6

querie

Compose Ecto query from the client side
Elixir
22
star
7

chubi

Simple and easy to extend elixir phoenix blog app
JavaScript
21
star
8

valdi

Simple data validation for elixir
Elixir
21
star
9

filtery

Build Ecto query using MongoDB-like query style.
Elixir
18
star
10

mindtree

Render mindmap from indented text or markdown formatted text
JavaScript
16
star
11

as_fsm

A finite state machine implementation for elixir
Elixir
14
star
12

tiModal

A simple, lightweight and pure javascript modal plugin
JavaScript
12
star
13

extus

An implementation of resumable upload protocol TUS in Elixir
Elixir
7
star
14

url-redirector

JavaScript
6
star
15

shower.maker

A tool for making presentation with https://github.com/shower/shower
JavaScript
4
star
16

gdrive

Upload and manage file on google drive in elixir
Elixir
4
star
17

ego

Elixir static site generator for everyone
CSS
3
star
18

upload_huge_file_example

An example project upload huge file by chunk in elixir
Elixir
3
star
19

t2map

load an excel/csv file to list of map
Elixir
2
star
20

domor-gtk

gtk version of domor, a simple pomodoro application, with many improved function
Python
2
star
21

elixlsx-writer

A writer for Elixlsx library which support writing large excel file
Elixir
2
star
22

djquery

JavaScript
2
star
23

contrak

Schema and Contract validation library for Elixir
Elixir
2
star
24

yexdl

A simple library convert youtube video id into direct mp4/webm video link
Elixir
2
star
25

nano-template

A lightweight and pure javascript template engine
HTML
2
star
26

skema

Define, cast & validate data again schema
Elixir
2
star
27

domor

A Simple pomodoro application which help you to apply Pomodoro techinque
Python
1
star
28

hattobox

Svelte
1
star
29

get10

A simple game that I build to learn game development
JavaScript
1
star