Skip to content

AutocompleteInput

Search-as-you-type field for selecting a single item from a search source.

<AutocompleteInputStory {...args} />
<CustomItemsStory {...args} />
<AutocompleteInputStory {...args} />
<AutocompleteInputStory {...args} />
<AutocompleteInputStory {...args} />
<AutocompleteInput
{...args}
debounceMs={0}
hasEntriesOnFocus
onChange={setValue}
searchSource={source}
value={value}
/>
<AutocompleteInput
{...args}
debounceMs={0}
onChange={setValue}
searchSource={source}
value={value}
/>
<div style={{display: 'grid', gap: 16}}>
<AutocompleteInput
{...args}
debounceMs={0}
label="Small"
onChange={setSmall}
searchSource={source}
size="sm"
value={small}
/>
<AutocompleteInput
{...args}
debounceMs={0}
label="Medium"
onChange={setMedium}
searchSource={source}
value={medium}
/>
<AutocompleteInput
{...args}
debounceMs={0}
label="Large"
onChange={setLarge}
searchSource={source}
size="lg"
value={large}
/>
</div>
<AutocompleteInput
{...args}
debounceMs={200}
onChange={setValue}
searchSource={source}
value={value}
/>
<AutocompleteInput
{...args}
debounceMs={0}
onChange={setValue}
searchSource={source}
value={value}
/>
<AutocompleteInputStory {...args} />
Search by name or role.
<AutocompleteInputStory {...args} />
<BaseAutocompleteInput
debounceMs={0}
hasEntriesOnFocus
onChange={setValue}
onQueryChange={setQuery}
placeholder="Search people"
query={query}
searchSource={source}
value={value}
/>
<AutocompleteInput
{...args}
debounceMs={0}
hasEntriesOnFocus
maxMenuItems={12}
onChange={setValue}
searchSource={source}
value={value}
/>
<div style={{display: 'grid', gap: 16}}>
<AutocompleteInput
{...args}
debounceMs={0}
isRequired
label="Required assignee"
onChange={setRequired}
searchSource={source}
value={required}
/>
<AutocompleteInput
{...args}
debounceMs={0}
isOptional
label="Optional reviewer"
onChange={setOptional}
searchSource={source}
value={optional}
/>
</div>

Search-as-you-type field for selecting a single item from a search source.

When isOptional: false, isRequired: false

PropTypeDefaultDescription
classNamestringAdditional CSS class names applied to the input wrapper.
data-testidstringTest ID applied to the input wrapper.
debounceMsnumber150Debounce delay in milliseconds before search runs.
descriptionReactNodeSupporting text rendered below the label.
emptySearchResultsTextstring'No results found'Empty state text.
errorTextstring'Something went wrong'Text shown in the menu when a search fails.
hasAutoFocusbooleanfalseWhether to focus the input on mount.
hasClearbooleantrueWhether to show a clear button when a value is selected.
hasEntriesOnFocusbooleanfalseWhether to show bootstrap results on focus before typing.
isDisabledbooleanfalseWhether the input is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
label*stringField label.
labelIconIconComponentIcon shown before the label.
labelTooltipReactNodeTooltip content shown next to the label.
maxMenuItemsnumber10Maximum number of menu items.
onChange*(item: T | null) => voidCalled when selection changes.
onOpenChange(isOpen: boolean) => voidCalled when the result popover opens or closes.
onQueryChange(query: string) => voidCalled when the query changes.
placeholderstringPlaceholder text.
refRef<HTMLDivElement>Ref forwarded to the field root.
renderItem(item: T) => ReactNodeCustom result renderer.
searchSource*SearchSource<T>Provides results for the menu. Use createStaticSearchSource for in-memory data, or implement SearchSource for async/remote search.
size"sm" | "md" | "lg"'md'Visual size.
startIconIconComponentIcon shown before the input.
statusInputStatusValidation status displayed below the selector.
styleCSSPropertiesInline styles applied to the input wrapper.
value*T | nullSelected item.
isOptionalfalse
isRequiredfalse

When isOptional: true, isRequired: false

PropTypeDefaultDescription
classNamestringAdditional CSS class names applied to the input wrapper.
data-testidstringTest ID applied to the input wrapper.
debounceMsnumber150Debounce delay in milliseconds before search runs.
descriptionReactNodeSupporting text rendered below the label.
emptySearchResultsTextstring'No results found'Empty state text.
errorTextstring'Something went wrong'Text shown in the menu when a search fails.
hasAutoFocusbooleanfalseWhether to focus the input on mount.
hasClearbooleantrueWhether to show a clear button when a value is selected.
hasEntriesOnFocusbooleanfalseWhether to show bootstrap results on focus before typing.
isDisabledbooleanfalseWhether the input is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
label*stringField label.
labelIconIconComponentIcon shown before the label.
labelTooltipReactNodeTooltip content shown next to the label.
maxMenuItemsnumber10Maximum number of menu items.
onChange*(item: T | null) => voidCalled when selection changes.
onOpenChange(isOpen: boolean) => voidCalled when the result popover opens or closes.
onQueryChange(query: string) => voidCalled when the query changes.
placeholderstringPlaceholder text.
refRef<HTMLDivElement>Ref forwarded to the field root.
renderItem(item: T) => ReactNodeCustom result renderer.
searchSource*SearchSource<T>Provides results for the menu. Use createStaticSearchSource for in-memory data, or implement SearchSource for async/remote search.
size"sm" | "md" | "lg"'md'Visual size.
startIconIconComponentIcon shown before the input.
statusInputStatusValidation status displayed below the selector.
styleCSSPropertiesInline styles applied to the input wrapper.
value*T | nullSelected item.
isOptional*true
isRequiredfalse

When isOptional: false, isRequired: true

PropTypeDefaultDescription
classNamestringAdditional CSS class names applied to the input wrapper.
data-testidstringTest ID applied to the input wrapper.
debounceMsnumber150Debounce delay in milliseconds before search runs.
descriptionReactNodeSupporting text rendered below the label.
emptySearchResultsTextstring'No results found'Empty state text.
errorTextstring'Something went wrong'Text shown in the menu when a search fails.
hasAutoFocusbooleanfalseWhether to focus the input on mount.
hasClearbooleantrueWhether to show a clear button when a value is selected.
hasEntriesOnFocusbooleanfalseWhether to show bootstrap results on focus before typing.
isDisabledbooleanfalseWhether the input is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
label*stringField label.
labelIconIconComponentIcon shown before the label.
labelTooltipReactNodeTooltip content shown next to the label.
maxMenuItemsnumber10Maximum number of menu items.
onChange*(item: T | null) => voidCalled when selection changes.
onOpenChange(isOpen: boolean) => voidCalled when the result popover opens or closes.
onQueryChange(query: string) => voidCalled when the query changes.
placeholderstringPlaceholder text.
refRef<HTMLDivElement>Ref forwarded to the field root.
renderItem(item: T) => ReactNodeCustom result renderer.
searchSource*SearchSource<T>Provides results for the menu. Use createStaticSearchSource for in-memory data, or implement SearchSource for async/remote search.
size"sm" | "md" | "lg"'md'Visual size.
startIconIconComponentIcon shown before the input.
statusInputStatusValidation status displayed below the selector.
styleCSSPropertiesInline styles applied to the input wrapper.
value*T | nullSelected item.
isOptionalfalse
isRequired*true

Internal combobox engine used by AutocompleteInput and TagsInput.

PropTypeDefaultDescription
anchorRefRefObject<HTMLElement | null>Ref to the element the result popover should align to.
ariaDescribedBystringIDs describing the input.
classNamestringAdditional CSS class names applied to the input.
data-testidstringTest ID applied to the input element.
debounceMsnumber150Debounce delay in milliseconds before search runs.
emptySearchResultsTextstring'No results found'Empty state text.
errorTextstring'Something went wrong'Text shown in the menu when a search fails.
hasAutoFocusbooleanfalseWhether to focus the input on mount.
hasEntriesOnFocusbooleanfalseWhether to show bootstrap results on focus before typing.
hasReopenOnSelectbooleanfalseWhether to re-bootstrap results after selecting an item. Useful for multi-select comboboxes where the user picks several items in a row.
inputIdstringOptional ID for the input.
isDisabledbooleanfalseWhether the input is disabled.
isRequiredbooleanfalseWhether the input is required.
maxMenuItemsnumber10Maximum number of menu items.
onChange*(item: T | null) => voidCalled when a result is selected.
onKeyDown(event: KeyboardEvent<HTMLInputElement>) => voidKeyboard handler invoked before internal navigation.
onOpenChange(isOpen: boolean) => voidCalled when the result popover opens or closes.
onQueryChange*(query: string) => voidCalled when the query changes.
placeholderstring'Search...'Placeholder text.
query*stringCurrent query string.
refRef<HTMLInputElement>Ref forwarded to the input.
renderItem(item: T) => ReactNodeCustom result renderer.
searchSource*SearchSource<T>Provides results for the menu. Use createStaticSearchSource for in-memory data, or implement SearchSource for async/remote search.
size'sm' | 'md' | 'lg''md'Visual size.
styleCSSPropertiesInline styles applied to the input.
value*T | nullSelected item.

Default layout for AutocompleteInput and TagsInput result rows. When the item has a pre-rendered `element`, it is returned directly. Otherwise the component renders a flex row with an optional icon, primary label, and description.

When Variant 1

PropTypeDefaultDescription
item*SearchableItem & {element: ReactNode}Search result item with custom element content.

When Variant 2

PropTypeDefaultDescription
classNamestringAdditional CSS class names applied to the item layout.
data-testidstringTest ID applied to the item layout.
descriptionReactNodeSupporting text displayed below the label.
iconIconComponentIcon or avatar rendered before the label.
isDisabledbooleanfalseWhether the item is disabled.
item*SearchableItem & {element?: undefined}Search result item without a custom element.
refRef<HTMLDivElement>Ref forwarded to the item layout.
styleCSSPropertiesInline styles applied to the item layout.