Skip to main content
v7

Autocomplete

Search and choose one or more options from a list.

Package@g4rcez/componentsSectionForm Controls

Examples

Basic Autocomplete

A basic autocomplete with a list of programming languages. Selecting an option updates the controlled value.

Create a New Option

Use dynamicOption to select a suggested language or enter a new one without an option validation error. Press Enter, select the option, or leave the field to accept the typed value.

Left and Right Content

left and right put an icon, a hint or any element inside the field, before the text and next to the caret. The right content sits before the caret and the clear button, so those controls keep working. Decorative icons take aria-hidden, and the field keeps its own label.

Empty and Disabled States

Demonstrates autocomplete in empty and disabled states.

Autocomplete in Modal

Demonstrates how Autocomplete behaves when placed inside a Modal component.

Field Sizes

Use size=normal or size=small when you need autocomplete fields to fit different densities.

When to use Autocomplete

Use when

Use Autocomplete when a user selects one or more known options from a searchable list.

Avoid when

Avoid it for a short, stable list that is faster to scan as native radio buttons or a select.

Accessibility

Keep the field labeled, announce the expanded state, and make option movement and selection available from the keyboard.