Skip to content

Commit e332dd6

Browse files
authored
docs: improve code demo and documentation
1 parent e6add1d commit e332dd6

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

packages/multiple-select-vanilla/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,18 @@ import { multipleSelect } from 'multiple-select-vanilla';
3030
const ms = multipleSelect('.multiple-select');
3131
```
3232

33-
##### 2. or from a `data` array or object
33+
#### 2. or from a `data` array of string/numbers or text/value pair (object array)
3434

3535
```ts
3636
import { multipleSelect } from 'multiple-select-vanilla';
3737

38+
const ms = multipleSelect('.multiple-select', {
39+
data: ['First', 'Second'] // native string/number/boolean
40+
};
41+
3842
const ms = multipleSelect('.multiple-select', {
3943
data: [
44+
// text/value pair
4045
{ text: 'First', value: 1 },
4146
{ text: 'Second', value: 2 },
4247
{ text: 'Third', value: 3 },

0 commit comments

Comments
 (0)