Skip to content
On this page

useSelection

Basic

useSelection allows you to create v-model like binding for a group.

You can use multi property to enable selecting multiple values from options.

Selected: undefined

Indexed

You can also create options without predefined value. Pass any positive number to options property and it will create index based options.

Selected: undefined

Object

description

Home
Categories
Cart
Profile
Selected:

Initial Value

You can set initial value for selection by passing it to initialValue property.

Selected: banana

INFO

useSelection will watch for changes in initialValue and update selection.

Released under the MIT License.