AutoComplete API

API documentation for AutoComplete component

AutoCompleteRoot#

Props#

Defines valid properties in AutoComplete component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AutoCompleteRootInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AutoCompleteRootInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AutoCompleteRootPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AutoCompleteRootInstance) => ReactNode)
null
The children to render.
invalidboolean
null
When present, it specifies that the component should have invalid state style.
variant"outlined" | "filled"
null
Specifies the input variant of the component.
fluidboolean
null
Spans 100% width of the container when enabled.
disabledboolean
false
When present, it specifies that the element should be disabled.
size"small" | "large"
null
Defines the size of the checkbox.
onValueChange(event: AutoCompleteValueChangeEvent) => void
null
Callback fired when the autocomplete's input value is changed.
onInputValueChange(event: AutoCompleteInputValueChangeEvent) => void
null
Callback fired when the autocomplete's input value is changed.
onComplete(event: AutoCompleteCompleteEvent) => void
null
Callback fired when the autocomplete's search is completed.
valueunknown
null
The current selected value of the autocomplete.
defaultValueunknown
null
The default selected value when used in uncontrolled mode.
inputValuestring
null
The current input text value (controlled).
defaultInputValuestring
null
The default input text value when used in uncontrolled mode.
openboolean
null
Controlled open state of the input tags overlay.
defaultOpenboolean
null
Default open state for uncontrolled mode.
optionsunknown[]
null
An array of options to display.
optionKeystring
null
Unique key for each option.
optionLabelstring
null
Label field for each option.
optionValuestring
null
Value field for each option.
optionDisabledstring
null
Field to check if an option is disabled.
optionGroupLabelstring
null
Label field for option groups.
optionGroupChildrenstring
null
Field that contains the children options in a group.
localestring
null
The locale to use for localization.
multipleboolean
null
When present, allows selecting multiple options.
metaKeySelectionboolean
null
When enabled, requires holding the meta key to select/deselect.
autoOptionFocusboolean
null
When enabled, the focused option is automatically highlighted.
selectOnFocusboolean
null
When enabled, the focused option is automatically selected.
focusOnHoverboolean
null
When enabled, the focused option changes on hover.
minLengthnumber
null
Minimum number of characters to initiate a search.
delaynumber
null
Delay between keystrokes to wait before sending a query.
appendToHTMLElement | "body" | "self"
null
A valid query selector or an HTMLElement to specify where the overlay gets attached.
forceSelectionboolean
null
When present, it specifies that an input field must be filled out before submitting the form.
completeOnFocusboolean
null
When enabled, a search query is sent on focus.
tabIndexnumber
null
Index of the element in tabbing order.
namestring
null
Name of the input element.
requiredboolean
null
When present, it specifies that an input field is required.
dropdownMode"current" | "blank"
null
Specifies the behavior of the dropdown button.
onOpenChange(event: useAutoCompleteOpenChangeEvent) => void
null
Callback to invoke when the open state changes.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Defines valid state in AutoComplete component.

nametypedefaultdescription
valueunknown
null
The current selected value.
inputValuestring
null
The current input text value.
openedboolean
null
Whether the overlay is open.
focusedboolean
null
Whether the input is focused.
focusedOptionIndexnumber
null
The index of the currently focused option. -1 if no option is focused.
searchingboolean
null
Whether a search is in progress.
anchorElHTMLElement
null
The anchor (input) element.
positionerElHTMLDivElement
null
The positioner element.

Exposes#

Defines the methods and properties exposed by AutoComplete component.

nametypedefaultdescription
stateuseAutoCompleteState
null
The state of the useAutoComplete.
listboxuseListboxInstance
null
The listbox instance used internally for option management.
presence{ present: boolean; exiting: boolean; mounted: boolean; ref: RefObject<HTMLElement> }
null
The presence state for managing mount/unmount transitions.
inputRefRefObject<{ elementRef: RefObject<HTMLInputElement> }>
null
Reference to the input element.
setAnchorRef(node: HTMLElement) => void
null
Sets the anchor (input) element reference.
setPositionerRef(node: HTMLDivElement) => void
null
Sets the positioner element reference.
onChange(event: ChangeEvent<HTMLInputElement>) => void
null
Callback when the input value changes.
onFocus(event: FocusEvent<HTMLInputElement>) => void
null
Callback when the input receives focus.
onBlur(event: FocusEvent<HTMLInputElement>) => void
null
Callback when the input loses focus.
onKeyDown(event: KeyboardEvent<HTMLInputElement>) => void
null
Callback when a key is pressed in the input.
onTriggerClick(event: MouseEvent<HTMLButtonElement>) => void
null
Callback when the dropdown trigger is clicked.
onClearClick(event: MouseEvent<HTMLButtonElement>) => void
null
Callback when the clear button is clicked.
onOptionSelect(event: { originalEvent: SyntheticEvent; value: unknown }) => void
null
Callback when an option is selected.
getFocusedOptionId() => string
null
Gets the ID of the currently focused option for aria-activedescendant.
hasValue() => boolean
null
Returns whether the autocomplete has a selected value.

Events#

Event fired when the autocomplete's value changes.

nametypedescription
valuestringThe new value of the autocomplete.
optionunknownThe selected option.
originalEventSyntheticEventThe original event that triggered the change.

Event fired when the autocomplete's input value changes.

nametypedescription
querystringThe current input value.
originalEventSyntheticEventThe original event that triggered the change.

Event fired when the autocomplete's search is completed.

nametypedescription
querystringThe current query string.
originalEventSyntheticEventThe original event that triggered the complete.

Event object for the onOpenChange callback.

nametypedescription
valuebooleanThe new value of the autocomplete's open state.

Interfaces#

Defines passthrough(pt) options of AutoComplete component.

nametypedefaultdescription
rootAutoCompleteRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.
triggerAutoCompleteRootPassThroughType<HTMLAttributes<HTMLButtonElement>>
null
Used to pass attributes to the trigger's DOM element.
pcInputTextAutoCompleteRootPassThroughType<HTMLAttributes<HTMLInputElement>>
null
Used to pass attributes to the pcInputText's DOM element.
portalAutoCompleteRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the portal's DOM element.
positionerAutoCompleteRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the positioner's DOM element.
panelAutoCompleteRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the panel's DOM element.
pcListboxAutoCompleteRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the pcListbox's DOM element.
optionsAutoCompleteRootPassThroughType<HTMLAttributes<HTMLUListElement>>
null
Used to pass attributes to the options' DOM element.
optionAutoCompleteRootPassThroughType<HTMLAttributes<HTMLLIElement>>
null
Used to pass attributes to the option's DOM element.
clearIconAutoCompleteRootPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the clearIcon's DOM element.
selectionAutoCompleteRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the selection's DOM element.
headerAutoCompleteRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the header's DOM element.
footerAutoCompleteRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the footer's DOM element.
emptyAutoCompleteRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the empty's DOM element.

Types#

Instance of AutoCompleteRoot component.

values
ComponentInstance<AutoCompleteRootProps, AutoCompleteRootState, AutoCompleteRootExposes>

AutoCompleteValue#

Props#

Defines valid properties in AutoCompleteValue component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AutoCompleteValueInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AutoCompleteValueInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AutoCompleteValuePassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AutoCompleteValueInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AutoCompleteValue component.

nametypedefaultdescription
autocompleteAutoCompleteRootInstance
null
The AutoComplete component instance.

Interfaces#

Defines passthrough(pt) options of AutoCompleteValue component.

nametypedefaultdescription
rootAutoCompleteValuePassThroughType<HTMLAttributes<HTMLInputElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AutoCompleteValue component.

values
ComponentInstance<AutoCompleteValueProps, AutoCompleteValueState, AutoCompleteValueExposes>

AutoCompleteTrigger#

Props#

Defines valid properties in AutoCompleteTrigger component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AutoCompleteTriggerInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AutoCompleteTriggerInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AutoCompleteTriggerPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AutoCompleteTriggerInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AutoCompleteTrigger component.

nametypedefaultdescription
autocompleteAutoCompleteRootInstance
null
The AutoComplete component instance.

Interfaces#

Defines passthrough(pt) options of AutoCompleteTrigger component.

nametypedefaultdescription
rootAutoCompleteTriggerPassThroughType<HTMLAttributes<HTMLButtonElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AutoCompleteTrigger component.

values
ComponentInstance<AutoCompleteTriggerProps, AutoCompleteTriggerState, AutoCompleteTriggerExposes>

AutoCompletePortal#

Props#

Defines valid properties in AutoCompletePortal component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
style(CSSProperties | ((instance?: PortalInstance) => CSSProperties)) & (CSSProperties | ((instance?: AutoCompletePortalInstance) => CSSProperties))
null
The style to apply to the component.
className(string | ((instance?: PortalInstance) => string)) & (string | ((instance?: AutoCompletePortalInstance) => string))
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptPortalPassThrough & Record<PropertyKey, unknown> & AutoCompletePortalPassThrough
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
children(ReactNode | ((instance: PortalInstance) => ReactNode)) & (ReactNode | ((instance: AutoCompletePortalInstance) => ReactNode))
null
The children to render.
elementReactNode
null
The element to be rendered as the portal.
appendToHTMLElement | "body" | "self"
'body'
The DOM element where the portal should be appended to.
visibleboolean
false
Whether the portal is visible or not.
onMounted() => void
null
Callback function to invoke when the portal is mounted.
onUnmounted() => void
null
Callback function to invoke when the portal is unmounted.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AutoCompletePortal component.

nametypedefaultdescription
autocompleteAutoCompleteRootInstance
null
The AutoComplete component instance.

Interfaces#

Defines passthrough(pt) options of AutoCompletePortal component.

nametypedefaultdescription
rootAutoCompletePortalPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AutoCompletePortal component.

values
ComponentInstance<AutoCompletePortalProps, AutoCompletePortalState, AutoCompletePortalExposes>

AutoCompletePositioner#

Props#

Defines valid properties in AutoCompletePositioner component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AutoCompletePositionerInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AutoCompletePositionerInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AutoCompletePositionerPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AutoCompletePositionerInstance) => ReactNode)
null
The children to render.
sideSideType
null
The side of the positioner.
alignAlignType
null
The align of the positioner.
sideOffsetnumber
null
The side offset of the positioner.
alignOffsetnumber
null
The align offset of the positioner.
flipboolean
null
Whether to flip the positioner.
shiftboolean
null
Whether to shift the positioner.
hideWhenDetachedboolean
null
Whether to hide the positioner when detached.
anchorHTMLElement
null
The anchor element.
contentHTMLDivElement
null
The content element.
arrowHTMLDivElement
null
The arrow element.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AutoCompletePositioner component.

nametypedefaultdescription
autocompleteAutoCompleteRootInstance
null
The AutoComplete component instance.

Interfaces#

Defines passthrough(pt) options of AutoCompletePositioner component.

nametypedefaultdescription
rootAutoCompletePositionerPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AutoCompletePositioner component.

values
ComponentInstance<AutoCompletePositionerProps, AutoCompletePositionerState, AutoCompletePositionerExposes>

AutoCompletePanel#

Props#

Defines valid properties in AutoCompletePanel component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AutoCompletePanelInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AutoCompletePanelInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AutoCompletePanelPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AutoCompletePanelInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AutoCompletePanel component.

nametypedefaultdescription
autocompleteAutoCompleteRootInstance
null
The AutoComplete component instance.

Interfaces#

Defines passthrough(pt) options of AutoCompletePanel component.

nametypedefaultdescription
rootAutoCompletePanelPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AutoCompletePanel component.

values
ComponentInstance<AutoCompletePanelProps, AutoCompletePanelState, AutoCompletePanelExposes>

AutoCompleteList#

Props#

Defines valid properties in AutoCompleteList component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AutoCompleteListInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AutoCompleteListInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AutoCompleteListPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AutoCompleteListInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AutoCompleteList component.

nametypedefaultdescription
autocompleteAutoCompleteRootInstance
null
The AutoComplete component instance.

Interfaces#

Defines passthrough(pt) options of AutoCompleteList component.

nametypedefaultdescription
rootAutoCompleteListPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AutoCompleteList component.

values
ComponentInstance<AutoCompleteListProps, AutoCompleteListState, AutoCompleteListExposes>

AutoCompleteOptions#

Props#

Defines valid properties in AutoCompleteOptions component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AutoCompleteOptionsInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AutoCompleteOptionsInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AutoCompleteOptionsPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AutoCompleteOptionsInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AutoCompleteOptions component.

nametypedefaultdescription
autocompleteAutoCompleteRootInstance
null
The AutoComplete component instance.
listboxListboxRootInstance
null
The Listbox component instance.

Interfaces#

Defines passthrough(pt) options of AutoCompleteOptions component.

nametypedefaultdescription
rootAutoCompleteOptionsPassThroughType<HTMLAttributes<HTMLUListElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AutoCompleteOptions component.

values
ComponentInstance<AutoCompleteOptionsProps, AutoCompleteOptionsState, AutoCompleteOptionsExposes>

AutoCompleteOption#

Props#

Defines valid properties in AutoCompleteOption component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AutoCompleteOptionInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AutoCompleteOptionInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AutoCompleteOptionPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AutoCompleteOptionInstance) => ReactNode)
null
The children to render.
optionunknown
null
The option data.
indexnumber
null
The index of the option.
selectedboolean
null
Whether the option is selected.
focusedboolean
null
Whether the option is focused.
disabledboolean
null
Whether the option is disabled.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AutoCompleteOption component.

nametypedefaultdescription
autocompleteAutoCompleteRootInstance
null
The AutoComplete component instance.
listboxListboxRootInstance
null
The Listbox component instance.
optionInstanceListboxOptionInstance
null
The ListboxOption component instance.
optionunknown
null
The option data object.
indexnumber
null
The index of the option in the list.
groupboolean
null
Whether this option is a group header.
selectedboolean
null
Whether this option is currently selected.

Interfaces#

Defines passthrough(pt) options of AutoCompleteOption component.

nametypedefaultdescription
rootAutoCompleteOptionPassThroughType<HTMLAttributes<HTMLLIElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AutoCompleteOption component.

values
ComponentInstance<AutoCompleteOptionProps, AutoCompleteOptionState, AutoCompleteOptionExposes>

AutoCompleteClearIcon#

Props#

Defines valid properties in AutoCompleteClearIcon component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AutoCompleteClearIconInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AutoCompleteClearIconInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AutoCompleteClearIconPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AutoCompleteClearIconInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AutoCompleteClearIcon component.

nametypedefaultdescription
autocompleteAutoCompleteRootInstance
null
The AutoComplete component instance.

Interfaces#

Defines passthrough(pt) options of AutoCompleteClearIcon component.

nametypedefaultdescription
rootAutoCompleteClearIconPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AutoCompleteClearIcon component.

values
ComponentInstance<AutoCompleteClearIconProps, AutoCompleteClearIconState, AutoCompleteClearIconExposes>

AutoCompleteSelection#

Props#

Defines valid properties in AutoCompleteSelection component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AutoCompleteSelectionInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AutoCompleteSelectionInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AutoCompleteSelectionPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AutoCompleteSelectionInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AutoCompleteSelection component.

nametypedefaultdescription
autocompleteAutoCompleteRootInstance
null
The AutoComplete component instance.
listboxListboxRootInstance
null
The Listbox component instance.

Interfaces#

Defines passthrough(pt) options of AutoCompleteSelection component.

nametypedefaultdescription
rootAutoCompleteSelectionPassThroughType<HTMLAttributes<HTMLSpanElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AutoCompleteSelection component.

values
ComponentInstance<AutoCompleteSelectionProps, AutoCompleteSelectionState, AutoCompleteSelectionExposes>

AutoCompleteHeader#

Props#

Defines valid properties in AutoCompleteHeader component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AutoCompleteHeaderInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AutoCompleteHeaderInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AutoCompleteHeaderPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AutoCompleteHeaderInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AutoCompleteHeader component.

nametypedefaultdescription
autocompleteAutoCompleteRootInstance
null
The AutoComplete component instance.

Interfaces#

Defines passthrough(pt) options of AutoCompleteHeader component.

nametypedefaultdescription
rootAutoCompleteHeaderPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AutoCompleteHeader component.

values
ComponentInstance<AutoCompleteHeaderProps, AutoCompleteHeaderState, AutoCompleteHeaderExposes>

AutoCompleteFooter#

Props#

Defines valid properties in AutoCompleteFooter component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AutoCompleteFooterInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AutoCompleteFooterInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AutoCompleteFooterPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AutoCompleteFooterInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AutoCompleteFooter component.

nametypedefaultdescription
autocompleteAutoCompleteRootInstance
null
The AutoComplete component instance.

Interfaces#

Defines passthrough(pt) options of AutoCompleteFooter component.

nametypedefaultdescription
rootAutoCompleteFooterPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AutoCompleteFooter component.

values
ComponentInstance<AutoCompleteFooterProps, AutoCompleteFooterState, AutoCompleteFooterExposes>

AutoCompleteEmpty#

Props#

Defines valid properties in AutoCompleteEmpty component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: AutoCompleteEmptyInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: AutoCompleteEmptyInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<AutoCompleteEmptyPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: AutoCompleteEmptyInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by AutoCompleteEmpty component.

nametypedefaultdescription
autocompleteAutoCompleteRootInstance
null
The AutoComplete component instance.

Interfaces#

Defines passthrough(pt) options of AutoCompleteEmpty component.

nametypedefaultdescription
rootAutoCompleteEmptyPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of AutoCompleteEmpty component.

values
ComponentInstance<AutoCompleteEmptyProps, AutoCompleteEmptyState, AutoCompleteEmptyExposes>

useAutoComplete#

Props#

Props for the useAutoComplete hook.

nametypedefaultdescription
valueunknown
null
The current selected value of the autocomplete.
defaultValueunknown
null
The default selected value when used in uncontrolled mode.
inputValuestring
null
The current input text value (controlled).
defaultInputValuestring
null
The default input text value when used in uncontrolled mode.
openboolean
null
Controlled open state of the input tags overlay.
defaultOpenboolean
null
Default open state for uncontrolled mode.
optionsunknown[]
null
An array of options to display.
optionKeystring
null
Unique key for each option.
optionLabelstring
null
Label field for each option.
optionValuestring
null
Value field for each option.
optionDisabledstring
null
Field to check if an option is disabled.
optionGroupLabelstring
null
Label field for option groups.
optionGroupChildrenstring
null
Field that contains the children options in a group.
disabledboolean
null
When present, it specifies that the component should be disabled.
localestring
null
The locale to use for localization.
multipleboolean
null
When present, allows selecting multiple options.
metaKeySelectionboolean
null
When enabled, requires holding the meta key to select/deselect.
autoOptionFocusboolean
null
When enabled, the focused option is automatically highlighted.
selectOnFocusboolean
null
When enabled, the focused option is automatically selected.
focusOnHoverboolean
null
When enabled, the focused option changes on hover.
minLengthnumber
null
Minimum number of characters to initiate a search.
delaynumber
null
Delay between keystrokes to wait before sending a query.
appendToHTMLElement | "body" | "self"
null
A valid query selector or an HTMLElement to specify where the overlay gets attached.
forceSelectionboolean
null
When present, it specifies that an input field must be filled out before submitting the form.
completeOnFocusboolean
null
When enabled, a search query is sent on focus.
tabIndexnumber
null
Index of the element in tabbing order.
namestring
null
Name of the input element.
requiredboolean
null
When present, it specifies that an input field is required.
dropdownMode"current" | "blank"
null
Specifies the behavior of the dropdown button.
onValueChange(event: useAutoCompleteValueChangeEvent) => void
null
Callback to invoke when the selected value changes.
onInputValueChange(event: useAutoCompleteInputValueChangeEvent) => void
null
Callback when the input value changes.
onComplete(event: useAutoCompleteCompleteEvent) => void
null
Callback to invoke to search for suggestions.
onOpenChange(event: useAutoCompleteOpenChangeEvent) => void
null
Callback to invoke when the open state changes.

State#

Defines valid state in useAutoComplete.

nametypedefaultdescription
valueunknown
null
The current selected value.
inputValuestring
null
The current input text value.
openedboolean
null
Whether the overlay is open.
focusedboolean
null
Whether the input is focused.
focusedOptionIndexnumber
null
The index of the currently focused option. -1 if no option is focused.
searchingboolean
null
Whether a search is in progress.
anchorElHTMLElement
null
The anchor (input) element.
positionerElHTMLDivElement
null
The positioner element.

Exposes#

Defines the methods and properties exposed by useAutoComplete.

nametypedefaultdescription
stateuseAutoCompleteState
null
The state of the useAutoComplete.
listboxuseListboxInstance
null
The listbox instance used internally for option management.
presence{ present: boolean; exiting: boolean; mounted: boolean; ref: RefObject<HTMLElement> }
null
The presence state for managing mount/unmount transitions.
inputRefRefObject<{ elementRef: RefObject<HTMLInputElement> }>
null
Reference to the input element.
setAnchorRef(node: HTMLElement) => void
null
Sets the anchor (input) element reference.
setPositionerRef(node: HTMLDivElement) => void
null
Sets the positioner element reference.
onChange(event: ChangeEvent<HTMLInputElement>) => void
null
Callback when the input value changes.
onFocus(event: FocusEvent<HTMLInputElement>) => void
null
Callback when the input receives focus.
onBlur(event: FocusEvent<HTMLInputElement>) => void
null
Callback when the input loses focus.
onKeyDown(event: KeyboardEvent<HTMLInputElement>) => void
null
Callback when a key is pressed in the input.
onTriggerClick(event: MouseEvent<HTMLButtonElement>) => void
null
Callback when the dropdown trigger is clicked.
onClearClick(event: MouseEvent<HTMLButtonElement>) => void
null
Callback when the clear button is clicked.
onOptionSelect(event: { originalEvent: SyntheticEvent; value: unknown }) => void
null
Callback when an option is selected.
getFocusedOptionId() => string
null
Gets the ID of the currently focused option for aria-activedescendant.
hasValue() => boolean
null
Returns whether the autocomplete has a selected value.

Events#

Event fired when the autocomplete's value changes.

nametypedescription
originalEventEThe original event that triggered the change.
valuestringThe selected value.
optionunknownThe selected option object.

Event fired when the autocomplete's input value changes.

nametypedescription
originalEventEThe original event that triggered the change.
querystringThe current input value.

Event fired when the autocomplete triggers a search/complete action.

nametypedescription
originalEventEThe original event that triggered the complete.
querystringThe current query string.

Event object for the onOpenChange callback.

nametypedescription
valuebooleanThe new value of the autocomplete's open state.

Types#

Instance of useAutoComplete headless.

values
HeadlessInstance<useAutoCompleteProps, useAutoCompleteState, useAutoCompleteExposes>