A <Select> component for Svelte apps
npm install svelte-select
π₯ Examples of every prop, event, slot and more π₯
π REPL: Show me everything πΊ
``bash`
npm install svelte-select
List position and floating is powered by floating-ui, see their package-entry-points docs if you encounter build errors.
| Prop | Type | Default | Description |
| ---------------------- | --------- | --------------- | -------------------------------------------------------------- |
| items | any[] | [] | Array of items available to display / filter |any
| value | | null | Selected value(s) |any
| justValue | | null | READ-ONLY Selected value(s) excluding container object |string
| itemId | | value | Override default identifier |string
| label | | label | Override default label |string
| id | | null | id attr for input field |string
| filterText | | '' | Text to filter items by |string
| placeholder | | Please select | Placeholder text |boolean
| hideEmptyState | | false | When no items hide list |boolean
| listOpen | | false | Open/close list |string
| class | | '' | container classes |string
| containerStyles | | '' | Add inline styles to container |boolean
| clearable | | true | Enable clearing of value(s) |boolean
| disabled | | false | Disable select |boolean
| multiple | | false | Enable multi-select |boolean
| searchable | | true | If false search/filtering is disabled |boolean
| groupHeaderSelectable | | false | Enable selectable group headers |boolean
| focused | | false | Controls input focus |boolean
| listAutoWidth | | true | If false will ignore width of select |boolean
| showChevron | | false | Show chevron |object
| inputAttributes | | {} | Pass in HTML attributes to Select's input |boolean
| placeholderAlwaysShow | | false | When multiple placeholder text will always show |boolean
| loading | | false | Shows loading-icon. loadOptions will override this |number
| listOffset | | 5 | px space between select and list |number
| debounceWait | | 300 | milliseconds debounce wait |object
| floatingConfig | | {} | Floating UI Config |boolean
| hasError | | false | If true sets error class and styles |string
| name | | null | Name attribute of hidden input, helpful for form actions |boolean
| required | | false | If Select is within a