Autocomplete
An input that suggests options as you type.
Note: The Autocomplete is a fully custom component with no external dependencies — built as a self-contained JavaScript component exposed through a Python API for use in Reflex.
Installation
Copy the following code into your app directory.
Command
Command
Manual
Manual
uv
Anatomy
Use the following composition to build an Autocomplete component.
Selected Value
Wire up on_select_item to capture the selected value.
Grouped List
Pass a group key to your data structure to group items together.
Large List
Autocomplete works efficiently with large lists — filtering happens entirely in the browser.
Custom Styling
Override any part of the component by passing a *_class prop. Classes are merged with the defaults via cn.
Empty State
When no items match the query, the empty state is shown automatically.