Native Select
Installation
Usage
Root renders a native select. Bind a
string for single selection, or a string array withmultiple . Option values are strings. UseOptGroup with alabel to
group options.
AssociateLabel with the select using
matchingfor andid values, or providearia-label . Native form attributes and change events pass through. Thesize attribute controls the number of visible rows.
The browser handles validation, keyboard selection, and the mobile picker. Use Select when you need a custom popup.
Multiple selection
Required field
API reference
NativeSelect.Root
| Prop | Type | Default |
|---|---|---|
multiple | false | undefined | true | false |
value Bindable | string | undefined | string[] | undefined | — |
NativeSelect.OptGroup
NativeSelect.Option
| Prop | Type | Default |
|---|---|---|
value | string | undefined | — |
pnpm dlx @mielui/svelte add native-select