Skip to main content

Select API

Properties
NameTypeDefaultDescription
itemsarray[]Options for the select. Each item has type, content, and value fields. Items may be grouped. Content is not sanitized — sanitize it in your application to prevent XSS.
namestringName attribute used when submitting in a form.
valuestringGets or sets the selected value.
contentstringReturns the human-readable label of the selected item. Read-only.
tabindexnumber0Tab index of the component.
placeholderstringPlaceholder text shown when no option is selected.
disabledbooleanfalseDisables the select.
readonlybooleanfalseSets the read-only state.
size"small" | "medium" | "large"Size of the select.
inlinebooleanfalseRenders the select as inline-block.
borderlessbooleanfalseRenders the select without a border.
errorbooleanfalseSets the error state.
loadingbooleanfalseSets the loading state of the option list.
openedbooleanfalseControls the open state via attribute. Use open() and close() methods for programmatic control.
disable-min-widthbooleanfalseSets the min-width of the component to 0.
always-show-searchbooleanfalseShows the search input even when there are fewer than 8 options.
search-hiddenbooleanfalseHides the search input even when there are more than 8 options.
clear-visiblebooleanfalseShows a clear button. Requires a placeholder to be set.
item-limitnumber0Maximum number of visible items. Items over the limit only appear in search results.
isReadyreadonly booleanIndicates whether the select is ready to open.
JavaScript API
NameKindDescription
open()actionOpens the option list.
close()actionCloses the option list.
Events
EventDescriptionReturns
changeFires when the selected option changes.Change event
searchFires on input in the search field.{ detail: { value: string } }
openFires when the dropdown opens.
closeFires when the dropdown closes.
readyFires when the component is ready to open.