v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS
Autocomplete
Editable text with optional suggestions.
Interactive preview
Usage
import { Autocomplete } from "@devvy-ui/react";
<Autocomplete label="City" options={[{ value: 'Manila', label: 'Manila' }]} />API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| options | ComboboxOption[] | required | Suggested values. |
| value / defaultValue | string | empty | Editable text. |
| onValueChange | (text: string) => void | — | Text/selection callback. |
Accessibility & behavior
Platform Behavior & Guidelines
Uses Combobox behavior while allowing free text. Suggestions are optional; submitted text does not require a matching option.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add autocompleteMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
Autocomplete.tsxREACT / TSX
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.