Pular para o conteúdo

Autocomplete

Este conteúdo não está disponível em sua língua ainda.

The Autocomplete component provides a text input that suggests options in real-time as the user types.
It is ideal for searching large datasets, selecting from predefined lists, or dynamically fetching options.

  • Real-time suggestions: Filters options as the user types.
  • Flexible data: Accepts arrays of objects or dynamic sources.
  • Variants: Supports multiple visual styles via the variant prop.
  • Custom rendering: You can customize how each item is rendered using slots.
PropTypeDefaultDescription
dataarray[]Array of items to display in suggestions.
variantstring"default"Visual style of the autocomplete input.
filter(item) => anyRequiredFunction used to filter the items based on input value.
placeholderstring""Placeholder text for the input.
renderInputslotOptionalCustom rendering of each suggestion item.
  • Keep the dataset reasonably sized for performance.
  • Use clear labels in your data to make suggestions understandable.
  • Provide custom rendering when you need links, icons, or complex content inside suggestions.
  • Choose a variant consistent with the surrounding form or UI style.