File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
packages/multiple-select-vanilla Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,42 @@ Available [**Live demo**](https://ghiscoding.github.io/multiple-select-vanilla/)
9
9
npm install multiple-select-vanilla
10
10
```
11
11
12
+ ## Basic Usage
13
+
14
+ #### 1. From a native ` <select> `
15
+
16
+ ``` html
17
+ <select class =" multiple-select full-width" data-test =" select1" >
18
+ <option value =" 1" >First</option >
19
+ <option value =" 2" >Second</option >
20
+ <option value =" 3" >Third</option >
21
+ <option value =" 4" >Fourth</option >
22
+ </select >
23
+ ```
24
+
25
+ and then initialize ms-select
26
+
27
+ ``` ts
28
+ import { multipleSelect } from ' multiple-select-vanilla' ;
29
+
30
+ const ms = multipleSelect (' .multiple-select' );
31
+ ```
32
+
33
+ ##### 2. From data
34
+
35
+ ``` ts
36
+ import { multipleSelect } from ' multiple-select-vanilla' ;
37
+
38
+ const ms = multipleSelect (' .multiple-select' , {
39
+ data: [
40
+ { text: ' First' , value: 1 },
41
+ { text: ' Second' , value: 2 },
42
+ { text: ' Third' , value: 3 },
43
+ { text: ' Fourth' , value: 4 },
44
+ ]
45
+ });
46
+ ```
47
+
12
48
## Changelog
13
49
14
50
[ CHANGELOG] ( https://github.com/ghiscoding/multiple-select-vanilla/blob/main/packages/multiple-select-vanilla/CHANGELOG.md )
You can’t perform that action at this time.
0 commit comments