Examples
Default
Error State
Sizes
Multi Select
Clearable
Props
Autocomplete
A combobox input with single- or multi-select, optional async loading, and native support for grouped + pinned options.- Pass
groupsplus anoptionsarray whose entries reference each group viagroupIdto render hierarchical lists with properrole="group"+aria-labelledbysemantics. Options without agroupIdrender above the first group; options markedpinnedrender above everything and bypass the search filter. - Indentation of nested rows (e.g. price under product) is controlled by the consumer via
renderOptionstyling — there is no built-in indent.
AutocompleteOption[]
required
string
string
string
boolean
default:"false"
string
boolean
default:"false"
((inputValue: string) => string)
boolean
string | string[] | null
boolean
default:"false"
string
boolean
default:"false"
string
((option: AutocompleteOption, query: string) => boolean)
boolean
default:"false"
AutocompleteGroup[]
Ordered list of groups. When provided, options whose
groupId matches an entry render under the corresponding heading. Groups with no visible (post-filter) options collapse silently. Pinned options render above everything; ungrouped options render between pinned and the first group. Only one level of grouping is supported.string
string
string
string
ReactNode
boolean
default:"false"
string
boolean
((value: string | null) => void) | ((values: string[]) => void)
((inputValue: string) => void)
((value: string) => void)
((open: boolean) => void)
boolean
string
((group: AutocompleteGroup) => ReactNode)
Custom renderer for group headings. The returned node is wrapped by the component in an element carrying the
id referenced by the surrounding role="group" wrapper’s aria-labelledby, so consumers only need to return visual content.((option: AutocompleteOption, state: { selected: boolean; active: boolean; }) => React ...
Full type:
((option: AutocompleteOption, state: { selected: boolean; active: boolean; }) => ReactNode).((option: AutocompleteOption, onRemove: () => void) => ReactNode)
"32" | "40" | "48"
default:"48"
string | string[] | null
Exported types
Also exported from@fanvue/ui: AutocompleteGroup, AutocompleteOption, AutocompleteProps, AutocompleteSize.
Setup: Installation · Theming