ui

Autocomplete

An input that suggests options as you type. Built with Base UI and Tailwind CSS. Copy-paste ready.

API Reference

Installation

Usage

API Reference

The AutocompleteInput component extends the original Base UI component with a few extra props:

Examples

Sizes

Renders the sm, default, and lg size variants to show how the autocomplete input scales across layout contexts.

With Label

Associates a Label with the autocomplete input for accessible identification without a Field wrapper.

Inline Autocomplete

Autofill the input with the highlighted item while navigating with arrow keys.

Auto Highlight

Sets mode="both" so the input filters the list while also completing the typed text inline, accepting the suggestion with Enter.

Trigger and Clear

Enables both showTrigger and showClear on AutocompleteInput to add a chevron toggle and an X clear button to the field.

With Clear Button

Enables showClear on AutocompleteInput to display an X button that resets the value when the field is non-empty.

With Search Icon

Prepends a search icon inside the input to visually reinforce the filtering behavior of the autocomplete field.

Grouped Items

Organizes options into labeled sections using AutocompleteGroup for categorized lists like countries by region.

Limit Results

Caps visible suggestions and shows a count of hidden matches.

Debounced remote search with loading and error states.

Form Integration

Wraps the autocomplete in Form and Field for required validation and a visible FieldError on submit.

Timezone Picker

Grouped by region with a monospace UTC offset badge on each item.

Person Picker

Rich assignee selector with avatar initials, email, and role badge.

Country Picker

Each item displays a flag emoji, full country name, and the ISO 3166-1 alpha-2 code aligned to the trailing edge. Includes a clear and trigger button.

Repository Picker

GitHub-style repository search showing the org/name in monospace, a language color dot, and a star count. Useful for linking issues or PRs to a repo.

Multi-select Tag Input

Selected items are displayed as dismissible Badge chips above the input. Choosing an item adds it to the chip list and clears the field; clicking the chip's × removes it.

Priority Selector

Each option renders a colored icon paired with a label and a one-line description explaining when to use that priority level.

Skill Picker with Groups

Options are organized into three AutocompleteGroup sections (Languages, Frameworks, Tools) with labeled separators between them.