Features Installation Usage/Examples Options Methods

@erwinstone/bs-select

v1.0.2

Bootstrap plugin to create select element with dropdown

Github

Features

Installation

Install with npm:

npm install @erwinstone/bs-select

Install from cdn:



			

Usage/Examples

Place css between <head></head> tags:

<head>
	...
	<link href="https://unpkg.com/@erwinstone/bs-select@1.0.2/dist/bs-select.min.css" rel="stylesheet">
</head>

Place js before </body> tag:

<body>
	...
	<script src="https://unpkg.com/@erwinstone/bs-select@1.0.2/dist/bs-select.min.js"></script>
</body>

* You can also use bs-select as javascript module:

<script src="yourscript.js" type="module"></script>

In yourscript.js file, import Bss (Change location according to your path):

import Bss from './path/to/bs-select.module.js'

Or you can use it directly in the html script as a module:

<script type="module">
	import Bss from './path/to/bs-select.module.js'
</script>
			

Examples:

1. Basic
2. Using Placeholder
3. Using Optgroup
4. Multiple
5. Search
6. Creatable
7. Clearable
8. Disabled
9. Disabled option
10. Sizing
11. Validation
This field is required.
Good choice.
This field is required.
Good choice.
12. Methods

Options

Name Type Default Description
search boolean false Show search input
create boolean false Allow to create a new one if no results found
clear boolean false Show clear button
maxHeight string 25rem Maximum height to show scrollbar

Methods

Name Params Returns Example
setValue string void
select.setValue('chrome')
removeValue string void
select.removeValue('chrome')
getValue null string | array
select.getValue()