Skip to main content

Combobox

The ty-combobox component is a versatile control that combines a drop-down list with an editable text box, allowing users to either select a value from the list or enter a custom value. It is particularly useful in scenarios where the list of options is long or when the user is expected to know the item they are selecting.

Usage​

Here's how you can use the ty-select component in your HTML code:

Live Editor
<ty-combobox placeholder="Type or choose an fruit">
  <ty-option value="apple" label="Apple"></ty-option>
  <ty-option value="banana" label="Banana"></ty-option>
  <ty-option value="watermelon" label="Watermelon"></ty-option>
</ty-combobox>
Result
Loading...

API​

The ty-combobox component accepts the following properties:

Properties​

NameDescriptionTypeDefault
placeholderPlaceholder textString''
valueValue of the selected optionString''
labellabel of the selected optionString''
disabledDisable the select componentBooleanfalse

Events​

NameDescriptionDetail
ty-changeFires when the select changes{ value: string, label: string }