Autocomplete
A searchable text input that suggests and filters matching options as you type.
Enter a registry URL with optional tags.
Show codeHide code
Installation
import {
Autocomplete,
AutocompleteInputGroup,
AutocompleteContent,
AutocompleteEmpty,
AutocompleteList,
AutocompleteItem,
} from "@makeplane/propel/components/autocomplete";Usage
import {
Autocomplete,
AutocompleteContent,
AutocompleteEmpty,
AutocompleteInputGroup,
AutocompleteItem,
AutocompleteList,
} from "@makeplane/propel/components/autocomplete";
import {
Field,
FieldDescription,
FieldError,
FieldLabel,
} from "@makeplane/propel/components/field";
import { Icon } from "@makeplane/propel/components/icon";
import { IconButton } from "@makeplane/propel/components/icon-button";
import { ChevronsUpDown, X } from "lucide-react";
const IMAGES = ["nginx:1.29-alpine", "node:22-slim", "postgres:18", "redis:8.2.2-alpine"];
export default function BasicDemo() {
return (
<Field name="containerImage">
<Autocomplete items={IMAGES} mode="both" required>
<FieldLabel size="lg" inset={false}>
Container image
</FieldLabel>
<AutocompleteInputGroup
size="lg"
placeholder="e.g. docker.io/library/node:latest"
clear={
<IconButton
variant="ghost"
size="md"
aria-label="Clear container image"
icon={<Icon icon={X} />}
/>
}
trigger={
<IconButton
variant="ghost"
size="md"
aria-label="Open container image"
icon={<Icon icon={ChevronsUpDown} />}
/>
}
/>
<FieldDescription size="lg">Enter a registry URL with optional tags.</FieldDescription>
<AutocompleteContent>
<AutocompleteEmpty>No matches</AutocompleteEmpty>
<AutocompleteList>
{(image: string) => (
<AutocompleteItem key={image} value={image} size="lg">
{image}
</AutocompleteItem>
)}
</AutocompleteList>
</AutocompleteContent>
<FieldError size="lg" />
</Autocomplete>
</Field>
);
}Examples
Search
Show codeHide code
Grouped
Grouped suggestions render each group under a label; filtering drops empty groups and their headings automatically.
Show codeHide code
Async
Hand filtering to the consumer with filter={null}, drive the lookup from value/onValueChange, and announce progress with AutocompleteStatus.
Show codeHide code
Fuzzy matching
A custom filter replaces the built-in contains match, so skipped-letter queries (e.g. ngx) still find their item.
Show codeHide code
Sizes
size steps the input row’s height, padding, and icon and text scale: md, lg, xl, or 2xl.
Show codeHide code
API Reference
Autocomplete
The autocomplete Root — Base UI's context/state provider (renders no element of its own). A behavior-only role, so it lives in `components` (rules 1a, 2); the styled parts live in `elements/autocomplete` and are grafted onto Base UI behavior here.
AutocompleteInputGroup
The ready-made autocomplete input row: grafts Base UI's `InputGroup` onto the styled bordered frame and Base UI's `Input` onto the styled text field, laying out an optional leading `icon` slot and the consumer-provided `clear`/`trigger` controls. All remaining props pass through to the input (the element that carries the combobox behavior and accessible name).
AutocompleteContent
The autocomplete list surface: Base UI portal + positioner + popup grafted onto Propel styling.
AutocompleteItem
The ready-made autocomplete option row: grafts Base UI's `Autocomplete.Item` behavior onto the shared listbox row (`layout="plain"` — autocomplete rows carry no selection marker). Children flow through as the row's content.