Autocomplete Field
A labeled autocomplete input with a filtered suggestion popup and helper or error text.
Show codeHide code
Installation
import { AutocompleteField } from "@makeplane/propel/components/autocomplete-field";Usage
import { AutocompleteField } from "@makeplane/propel/components/autocomplete-field";
import { Icon } from "@makeplane/propel/components/icon";
import { IconButton } from "@makeplane/propel/components/icon-button";
import { ChevronExpandOutline, CloseOutline } from "@makeplane/propel/icons";
const IMAGES = ["nginx:1.29-alpine", "node:22-slim", "postgres:18", "redis:8.2.2-alpine"];
export default function BasicDemo() {
return (
<AutocompleteField
name="containerImage"
label="Container image"
description="Type or choose an image tag."
size="lg"
items={IMAGES}
placeholder="e.g. node:22-slim"
empty="No images found"
clear={
<IconButton
variant="ghost"
size="md"
aria-label="Clear container image"
icon={<Icon icon={CloseOutline} />}
/>
}
trigger={
<IconButton
variant="ghost"
size="md"
aria-label="Open container image"
icon={<Icon icon={ChevronExpandOutline} />}
/>
}
/>
);
}Result identity and limits
Primitive string or number options key as themselves — no getItemKey needed. Record options
require getItemKey={(item) => item.id} (or another stable unique identity); TypeScript enforces
this. Keys must remain stable when results reorder; display labels may repeat.
The field displays up to 50 matches by default. When the shown list hits that cap and the source
list is longer, a polite status region announces truncatedMessage (default: “Keep typing to narrow
results”; overridable / suppressible with null). The hint is possibly-truncated — it does not
invent an exact remainder — so custom filter functions stay correct without a second full-catalog
pass. The searchable catalog is never truncated. limit={-1} displays every match and should be
reserved for bounded lists. limit={0} renders no rows, but the popup still opens and shows
empty even when matches exist — it is not a way to hold suggestions back. The same limit applies
to server-ranked filteredItems. Fetching stays application-owned; use value and onValueChange
for the query and pass [] for an empty response. For browsing large, accumulated result lists, use
Combobox Field.
Examples
Sizes
size steps the label, description, and helper text together with the input group and its input text.
Show codeHide code
Invalid
Setting error marks the field invalid, recolors the input group border, and replaces the description with the error text.
Show codeHide code
Disabled
Show codeHide code
API Reference
AutocompleteField
Ready-to-use autocomplete field with label, input, popup items, and helper/error text.
Record options require getItemKey. Primitive string/number options key as themselves when it is
omitted.