Autocomplete

Text input enhanced by a panel of suggested options. Supports combo-box, free solo, multiple selection, grouped options, async loading, and disabled options.

import{ Autocomplete } from "@pepulux/ui"

Combo box

Free solo — any arbitrary value allowed

Select from list or type a custom value

Controlled state

value: "react"

Multiple values

selected: ["react", "nextjs"]
ReactNext.js

Select one or more

Grouped options

Disabled options

Greyed options are unavailable

Async — load on open

Clearable

Click × to clear selection

Sizes — sm / md / lg

States — hint / destructive / disabled

Start typing to filter options

Please select an option

Props

PropTypeDefaultDescription
options*AutocompleteOption[]Array of { label, value, disabled? } objects
valuestringControlled selected value (single mode)
onChange(value: string) => voidCalled when a single option is selected or freeSolo value changes
multiplebooleanfalseEnable multi-select — renders chips above the input
multipleValuestring[]Controlled selected values in multiple mode
onMultipleChange(values: string[]) => voidCalled when selection changes in multiple mode
freeSolobooleanfalseAllow any arbitrary text value, not limited to options
clearablebooleanfalseShows × button to clear the current selection
loadingbooleanfalseShows spinner — use while async options are fetching
groupBy(opt: AutocompleteOption) => stringGroups options under labelled section headers
getOptionLabel(opt: AutocompleteOption) => stringCustom label resolver (defaults to opt.label)
noOptionsTextstring"No options"Text shown when no options match the query
size"sm" | "md" | "lg""md"Input height — 36 / 40 / 44px
labelstringField label above the input
placeholderstring"Select…"Placeholder text
hintstringHelper text below
destructivebooleanRed border error state (Figma Destructive prop)
errorTextstringError message (also activates destructive state)
disabledbooleanfalseDisables the entire field