Select
Single-select dropdown. The trigger matches Input chrome; option hover and selected states use a light brand wash, not a solid yellow block.
Demos
Basic
value and listen for change with e.detail.value. Options are slotted gk-option children. Value: pear
Custom loading and empty content
slot="loading" or slot="empty" to customize the corresponding listbox state. Loading and remote search
loading shows a loading state and blocks selection. remote emits a debounced search event with e.detail.query and a monotonically increasing e.detail.requestId. Keep the latest request id to ignore stale async responses. Size
sm / md / lg. Virtual scrolling
virtual for large option lists. Set item-height to the rendered option height in pixels. Clearable
clearable shows a clear control when a value is set. Status
status: success, warning, or error. Disabled
disabled blocks opening. Filterable
filterable adds a search field and filters by option label or value. Multiple
multiple keeps the menu open and renders selected values as tags. Bind value as a string array. Options display checkbox indicators while multiple selection is enabled. Selected: apple, pear
Maximum multiple selections
max to limit additions in multiple mode. Removing an already selected option remains available. Option groups and empty state
Use <gk-option-group label="…"> to visually group options. Disabled options are skipped by Arrow/Home/End keyboard navigation. An empty Select displays a No options status in the listbox.
Set filterable to show a search field while the listbox is open. Filtering matches option labels or values case-insensitively; Arrow keys and Enter continue to select from the filtered results.
Option groups
gk-option-group. A disabled group disables all its options. Empty state
API
Select Props
| Prop | Type | Default |
|---|---|---|
value | string | string[] | '' / [] when multiple |
placeholder | string | '' |
size | 'sm' | 'md' | 'lg' | 'md' |
disabled | boolean | false |
clearable | boolean | false |
filterable | boolean | false |
loading | boolean | false |
remote | boolean | false |
remote-debounce | number | 300 |
virtual | boolean | false |
item-height | number | 34 |
name | string | '' |
required | boolean | false |
State content can be customized with the loading and empty named slots. Use name to include the value in a native form submission and required to enable constraint validation. Calling form.reset() clears the Select value. | multiple | boolean | false | | max | number | 0 (unlimited) | | status | 'success' \| 'warning' \| 'error' \| '' | '' | | open | boolean | false |
Select Slots
| Name | Description |
|---|---|
| default | <gk-option value="…"> children |
| loading | Content shown while loading is true |
| empty | Content shown when no options are visible |
Select Events
| Name | Description |
|---|---|
change | detail: { value: string | string[] } |
search | detail: { query: string, requestId: number } after the remote debounce delay |
Option Props
| Prop | Type | Default |
|---|---|---|
value | string | '' |
disabled | boolean | false |
Option Group Props
| Prop | Type | Default |
|---|---|---|
label | string | '' |
disabled | boolean | false |