Autocomplete
The AutoComplete component provides suggestions while typing. It acts as a wrapper around TextInput.
Example Usage
Apple
Banana
Cherry
Date
Elderberry
No matches found
Object Options
You can pass an array of objects containing value and label.
John Doe
Jane Smith
Bob Johnson
No matches found
ObjectOptions.astro
<AutoComplete
id='ac-objects'
label='Users'
placeholder='Search users...'
options={[
{ value: 'john', label: 'John Doe' },
{ value: 'jane', label: 'Jane Smith' },
{ value: 'bob', label: 'Bob Johnson' }
]}
/> API
| 속성 | 설명 | 타입 | 기본값 |
|---|---|---|---|
| options | 옵션 배열 (문자열 또는 value 및 label이 있는 객체) | string[] | { value: string; label?: string }[] | [] |
| value | 현재 값 | string | |
| placeholder | 입력 자리 표시자 | string | |
| ...TextInputProps | Inherits all props from TextInput | any |