Components
AutoCompleteProps<T>
The properties for the AutoComplete component.
Type parameters
Type parameter | Description |
---|---|
T | The type of items managed by the AutoComplete component. |
Properties
- Name
className?
- Type
- string
- Description
The CSS class to apply to the AutoComplete component.
- Name
clearQueryOnSelect?
- Type
- boolean
- Description
Whether to clear the query string when an item is selected.
- Name
containerClassName?
- Type
- string
- Description
The CSS class to apply to the container of the AutoComplete component.
- Name
containerStyle?
- Type
- CSSProperties
- Description
The CSS styles to apply to the container of the AutoComplete component.
- Name
errorDisplay?
- Type
- (props: object) => ReactNode
- Description
A custom error display component to use when an error occurs.
- Name
getItemsForQuery
- Type
- (query: string) => T[] | Promise<T[]>
- Description
A function to fetch items based on the query string.
- Name
inputComponent?
- Type
- (p: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>) => ReactNode
- Description
A custom input component to use for the AutoComplete input field.
- Name
itemContainerClassName?
- Type
- string
- Description
The CSS class to apply to the container of the items list.
- Name
itemContainerStyle?
- Type
- CSSProperties
- Description
The CSS styles to apply to the container of the items list.
- Name
itemRenderer
- Type
- (props: object) => ReactNode
- Description
A custom renderer for items in the dropdown list.
- Name
itemToKey
- Type
- (item: T) => string
- Description
A function to get a unique key for an item.
- Name
itemToString
- Type
- (item: T) => string
- Description
A function to convert an item to its string representation.
- Name
loadingDisplay?
- Type
- (props: object) => ReactNode
- Description
A custom loading display component to use while items are being fetched.
- Name
onItemSelect?
- Type
- (item: T) => void
- Description
A callback function to handle the selection of an item.
- Name
onOpenChange?
- Type
- (b: boolean) => void
- Description
A callback function to handle changes to the open state of the dropdown.
- Name
onQueryChange?
- Type
- (s: string) => void
- Description
A callback function to handle changes to the query string.
- Name
open?
- Type
- boolean
- Description
Whether the AutoComplete dropdown is open.
- Name
placeholder?
- Type
- string
- Description
The placeholder text to display in the AutoComplete input field.
- Name
query?
- Type
- string
- Description
The current query string for the AutoComplete input field.
- Name
style?
- Type
- CSSProperties
- Description
The CSS styles to apply to the AutoComplete component.