Autocomplete
Remote user suggestions and other async results while a user types, with free-text input for search and tagging.
Purpose
Autocomplete combines free-text input with filtered suggestions. Use it for search, tagging, and command-like input where the typed value is meaningful. Use Select for a short closed list and Combobox when selection is constrained to listed options.
Suggestion input
Installation
With the Siteplane registry alias configured, add the component and import the installed source from your app.
CLI
pnpm dlx shadcn@4.16.1 add @siteplane/autocompleteImport
import { Autocomplete, AutocompleteEmpty, AutocompleteGroup, AutocompleteGroupLabel, AutocompleteInput, AutocompleteItem, AutocompleteList, AutocompletePopup, AutocompleteRow, AutocompleteStatus, useAutocompleteFilter } from "@/components/ui/autocomplete";Need the machine-readable source metadata? View registry JSON.
Usage
Use Autocomplete for suggestions while typing. Use the input group, popup, list and empty state together.
import { Autocomplete, AutocompleteInput, AutocompleteItem, AutocompleteList, AutocompletePopup } from "@/components/ui/autocomplete";
export function Example() {
return (
<Autocomplete>
<AutocompleteInput aria-label="Member" placeholder="Search members" showTrigger />
<AutocompletePopup>
<AutocompleteList>
<AutocompleteItem value="maya">Maya Chen</AutocompleteItem>
</AutocompleteList>
</AutocompletePopup>
</Autocomplete>
);
}Examples
Clear button, form fields, groups, icons, external filtering, sizes, states and status hints are props and compositions of the same primitive.
With clear button
Grouped items
With icons and start addon
External filtering (command-like)
Sizes
In a form field
States
With status
API Reference
The reference lists the source-owned exports and props that are easy to miss in visual examples. Inherited Base UI props remain available unless the wrapper narrows them.
- Render
AutocompleteInput,AutocompletePopup,AutocompleteList, andAutocompleteItemtogether. modeaccepts"list","both","inline", or"none"and controls how typed text is completed.AutocompletePopupacceptsside,align,sideOffset, andalignOffset; its defaults areside="bottom"andalign="start".AutocompleteItem disabledrepresents an unavailable suggestion.AutocompleteListprovides the bounded ScrollArea, scrollbar gutter, and scroll fade used by long result sets.AutocompleteRowsupports grid-style result layouts.AutocompleteStatusis the status line for loading and result messages;AutocompleteEmptyrenders the no-results state.- Filter through root
itemsoruseAutocompleteFilterwithfilteredItems.
Motion
Component motion uses the shared Siteplane motion contract. See the global motion guide for provider setup, tokens and reduced-motion behavior.
- Popup scale and fade, highlighted-item states, and reduced-motion behavior are native to the primitive.
- Filtering, highlighting, status, and empty-state changes do not resize the input.
- Interactive suggestions and icon actions use a pointer cursor; the text input keeps its text cursor.
Accessibility
- Give every
AutocompleteInputan accessible name through a visible label,aria-label, oraria-labelledby. - Keep disabled suggestions unavailable to pointer and keyboard selection.
- Connect invalid state to the input and render a visible
FieldError. - The popup remains keyboard navigable and closes on Escape or outside click.
Implementation Guidance
- Always compose the input, popup, list, and items; do not render a raw input without its suggestion list.
- Use
Fieldfor a visible label, description, and validation. - Preserve native filtering, highlight, cursor, popup, and motion behavior.