1.0.7 • Published 4 years ago

nativejs-select v1.0.7

Weekly downloads
16
License
MIT
Repository
github
Last release
4 years ago

npm version

nativejs-select

alt text

Why do I need use this?\ I made this plugin for me, because I don't need analogs with big size, the plugin have size only 6kb and have required options, the plugin written on Typescript without boilerplate. By the way the plugin has support IE11)

Getting started

yarn add nativejs-select
// or
npm install nativejs-select
<select class="customSelect">
  <option value="react">React</option>
  <option value="vue">Vue</option>
  <option value="svelte">Svelte</option>
</select>
import NativejsSelect from 'nativejs-select';
// or
const NativejsSelect = require('nativejs-select');
// Default styles
import 'nativejs-select/build/nativejs-select.css';

new NativejsSelect({
  selector: '.customSelect',
});

Options

NameTypeDesc
selectorstringselector of native select which you want to custom
placeholder?stringdisplay default placeholder after init
fixedPlaceholder?stringfixed placeholder
disableMobile?booleandisable castomization in mobile devices for better accessibility
renderOptions?(option: HTMLElement, index: number, length: number) => stringyou can render options like you want
enableSearch?booleanAllow search by options

You can also use html attributes for setup

Name
data-fixed-placeholder
data-placeholder
data-disable-mobile
data-enable-search

Cross-browser testing provided by \

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago