Ctrl + k
Theme:

Autocomplete

Autocomplete is a component that allows you to search and select a value from a list of options. It is a combination of a text input and a dropdown menu.

Apple
Orange
Peach
Banana
Apricot
value:

Disabled:
No result

Apple
Orange
Peach
Banana
Apricot
value:

Autocomplete only supports changed and input events.

a
b
c
d
e
f
changed: 0

0 items
No result

Apple
Orange
Peach
Banana
Apricot
Apple
Orange
Peach
Banana
Apricot
Apple
Orange
Peach
Banana
Apricot
Selected value: undefined

Apple
Orange
Peach
Banana
Apricot
value: Apple

Apple
Orange
Peach
Banana
Apricot
value:

You can have complex objects as item and using key prop you can extract the data that You need from Autocomplete.

2 - Third Item
0 - First Item
1 - Second Item
2 - Fourth Item
3 - Fifth Item
value: {"id":"third","value":"Third Item"}

You can set the valid or invalid boolean properties to apply the valid or invalid state to a Autocomplete.

No result
No result
No result

You can use key prop to set a custom key for the input element.

2 - Third Item
0 - First Item
1 - Second Item
2 - Fourth Item
3 - Fifth Item
2 - Third Item
0 - First Item
1 - Second Item
2 - Fourth Item
3 - Fifth Item
value: "third"

0 - Second Item
1 - Fourth Item
0 - First Item
2 - Third Item
4 - Fifth Item
value: ["second","fourth"]

Apple
Orange
Peach
Banana
Apricot
value:

Apple
Orange
Peach
Banana
Apricot
value: Apple

First Item
Second Item
Third Item
Fourth Item
Fifth Item
value: undefined

You can use any component inside Autocomplete like this:

User 2
User 1
User 3
user id: 2

Poland
Germany
Czech Republic
Brazil
value:
© 2024 YeSvelte. All Rights Reserved