Skip to main content

Prezentare generală

Folosiți Autocomplete pentru sugestii asociate unui câmp de introducere a textului. Câmpul de introducere își păstrează cursorul și focalizarea tastaturii în timp ce tastele săgeată evidențiază sugestiile. Folosiți Select atunci când utilizatorul trebuie să aleagă o valoare dintr-o listă fixă. Dropdown rămâne componenta de nivel superior pentru meniuri și selectoare.

Utilizare

Transmiteți items la Root și redați-le prin List, astfel încât filtrarea să actualizeze sugestiile vizibile. autoHighlight="always" evidențiază primul rezultat de fiecare dată când se deschide lista.
value și onValueChange controlează textul câmpului de intrare. Utilizați defaultValue pentru o valoare inițială necontrolată. Starea de deschidere este independentă: utilizați open și onOpenChange sau defaultOpen. Item.onClick gestionează atât selectarea cu indicatorul, cât și apăsarea Enter din câmpul de intrare. mode="list" filtrează fără a modifica textul intrării la evidențiere. mode="both" furnizează, de asemenea, completare în linie. mode="inline" păstrează toate elementele și furnizează completare în linie; mode="none" păstrează toate elementele fără completare în linie. readOnly împiedică completarea în linie să modifice intrarea.

Anatomie

Păstrați părțile asociate în interiorul unui Autocomplete.Root montat. Compuneți separat destinația portalului, învelișul de poziționare și conținutul. InputGroup grupează opțional intrarea cu controalele adiacente și ancorează fereastra pop-up la acel grup.
Părțile redate păstrează atributele native, gestionarele, referințele, className și style bazate pe stare, precum și compunerea render de element/funcție din API-ul Base UI instalat. Proprietățile native și referințele vizează propriul element al părții. Componentele personalizate trebuie să redirecționeze proprietățile și referințele furnizate. Proprietățile părților publice și tipurile de stare sunt exportate din twenty-ui/primitives/input, împreună cu acțiunile Root și tipurile de detalii ale evenimentelor de modificare/evidențiere. Autocomplete.useFilter() furnizează potriviri contains, startsWith și endsWith adaptate la setările regionale. Autocomplete.useFilteredItems\<TItem>() citește colecția filtrată intern din Root. Tratați acest rezultat ca fiind doar în citire.

Elemente obiect și grupate

Elementele pot fi șiruri sau obiecte arbitrare. Utilizați itemToStringValue pentru a furniza textul utilizat pentru filtrare, completare și trimiterea formularului. Obiectele cu forma { value, label } își folosesc automat eticheta. Redați aceeași valoare de element furnizată prin Root; nu este necesară nicio formă de element specifică Twenty sau proprietate pentru egalitatea selecției. Autocomplete gestionează intrarea de text, nu o valoare de obiect selectat separată. Pentru date grupate, transmiteți grupuri cu o matrice items. Root păstrează tipul elementului pentru itemToStringValue și onItemHighlighted. Redați elementele copil filtrate ale fiecărui grup prin Group și Collection:
Item.startIcon, Item.endIcon și Item.description furnizează conținut suplimentar. Compuneți Trigger și Clear cu Button din Twenty UI prin render. Icon poate conține o pictogramă din twenty-ui/icon. Păstrați Status și Empty montate în timp ce actualizați elementele lor copil, astfel încât cititoarele de ecran să poată anunța modificările.

Filtrare externă și sugestii de la server

Utilizați filteredItems când aplicația dvs. gestionează filtrarea. Aceasta trebuie să păstreze structura plată sau grupată a items. filter acceptă o funcție de potrivire personalizată; filter={null} dezactivează filtrarea internă pentru rezultatele deja filtrate de un server.
Păstrați Root montat când rezultatele sosesc asincron. Controlați open independent, astfel încât un răspuns să poată deschide sugestiile cât timp intrarea rămâne focalizată. Un Status montat poate anunța încărcarea; actualizați Empty când răspunsul finalizat nu are rezultate. Componenta părinte gestionează debounce-ul, anularea cererilor și protecția împotriva răspunsurilor învechite. onValueChange și onOpenChange primesc detaliile evenimentului din amonte, inclusiv reason, event nativ, trigger, cancel() și allowPropagation(). Apelanții controlați decid ce actualizări solicitate să confirme. De exemplu, ignorați modificarea valorii escape-key pentru a păstra o interogare a serverului sau ignorați deschiderea input-change până când sosesc rezultatele. onItemHighlighted primește elementul original tipizat și motivul evidențierii sale. Anularea păstrează semantica Base UI instalată; nu înlocuiește politica aplicației privind starea controlată.

Compunerea intrării și formulare native

Input acceptă size="sm" sau size="md" și utilizează aceleași stiluri ca Input. Compuneți-l cu o intrare existentă utilizând render. Controlul compus își gestionează apoi propriul aspect: Input nu adaugă stiluri Input și ignoră size, dar transmite în continuare className, atributele native, gestionarii de evenimente, ref și atributele de stare. Transmite-le elementului de input propriu-zis. Redă Input din Twenty UI pentru a păstra aspectul standard. InputGroup oferă aspect și o ancoră fără a adăuga borduri câmpului de intrare. Poate conține cipuri sau poate reda un înveliș existent. Folosește InputGroup prin intermediul prop-ului său render atunci când întregul grup are nevoie de stilizarea inputului, așa cum se întâmplă în scenariul sugestiilor de obiecte grupate. Un Input fără render în interiorul său își elimină propria bordură. Oferiți câmpului de intrare o etichetă accesibilă sau compuneți-l cu Field. Root păstrează comportamentul din amonte pentru name, form, disabled, readOnly și formularele native. Atributele native și referința lui Input vizează intrarea sa. submitOnItemClick activează trimiterea formularului la selectarea unei sugestii; comportamentul implicit nu trimite formularul. Input păstrează gestionarea IME nativă a Base UI, inclusiv evenimentele de compunere și protecția sa de confirmare prin tastatură. Versiunea Base UI instalată păstrează o interogare necontrolată la resetarea formularului nativ. Pentru o interogare controlată, gestionați onReset al formularului și restaurați valoarea inițială a aplicației.

Poziționare, destinația portalului și închidere

Positioner are implicit side="bottom", align="start" și sideOffset={8}. Păstrează contractul de ancorare și poziționare Base UI instalat, inclusiv ancore de element/referință/funcție/virtuale, decalaje funcționale, positionMethod, collisionBoundary, collisionPadding, collisionAvoidance, arrowPadding, sticky și disableAnchorTracking. Configurați-le pe Positioner. DirectionProvider controlează poziționarea logică și direcția DOM. Popup utilizează lățimea ancorei ca lățime minimă. Setați-i width pentru a furniza o lățime fixă a conținutului. Proprietățile sale native, stilurile, compunerea de randare și referința vizează elementul de conținut independent de Positioner și Portal. initialFocus și finalFocus ale Popup păstrează opțiunile de focalizare din amonte. Implicit, sugestiile păstrează focalizarea în intrare. Configurați container și keepMounted pe Portal. Omiterea containerului utilizează cea mai apropiată destinație ThemeProvider cu scop delimitat, apoi portalul părinte Base UI sau corpul documentului. Un null explicit așteaptă fără a reda până când este furnizat un container. Destinațiile de tip element, ShadowRoot și referință sunt transmise către Base UI. O referință nerezolvată păstrează alternativa portal părinte/corp a Base UI. Destinația implicită cu scop delimitat își păstrează tokenurile CSS și schema de culori. O destinație explicită moștenește CSS din domeniul său DOM real, deci plasați-o în domeniul temei dorite sau furnizați acele stiluri acolo. Contextul React și direcția rămân disponibile în portaluri. Țintele ShadowRoot au nevoie de CSS-ul bibliotecii și de stilurile temei în acel arbore shadow. Tastele săgeată modifică elementul evidențiat în timp ce intrarea păstrează focalizarea. Enter îl selectează; Escape și interacțiunea din exterior solicită închiderea folosind semantica din amonte. O apăsare în exterior poate activa controlul de destinație. Selectoarele de nivel superior pot gestiona o politică de activare diferită în adaptorul lor. Apelați event.preventBaseUIHandler() în onKeyDown al Input pentru a omite gestionarul încorporat pentru o tastă pe care o gestionați dvs. Utilizați și event.preventDefault() când suprimați acțiunea nativă a browserului. Root.inline cu open redă sugestiile fără ansamblul ferestrei pop-up. Elementele în linie își păstrează callbackurile de selecție onClick, dar componenta din amonte instalată completează automat intrarea numai când Popup-ul său este prezent. Gestionați Item.onClick când selecția în linie trebuie să actualizeze textul dvs. controlat. Root.grid și Row acceptă navigarea în grilă. Aceste moduri păstrează API-urile de colecție și randare din amonte.

Migrare

Încadrați Popup cu Autocomplete.Positioner și Autocomplete.Portal. Positioner necesită contextul Portal; sugestiile în linie omit întregul ansamblu al ferestrei pop-up. Mutați proprietățile de poziționare, ancoră și coliziune din Popup în Positioner. Mutați configurația container și de montare în Portal. Păstrați lățimea, stilurile conținutului, proprietățile native, gestionarele și referințele pe Popup. Utilizați un element copil Arrow explicit pentru o săgeată. În componentele front, păstrați politica existentă a portalului cu scop delimitat. Acest API nu extinde destinațiile portalului rendererului sau capacitățile de geometrie, derulare și închidere; aceste capacități ale rendererului au responsabilitate separată. Adaptoarele de selectoare pentru producție își păstrează fluxurile de activare deliberate.

Proprietăți

Referința este generată din tipurile componentei publice. Atributele native, numele accesibile și gestionarele de evenimente sunt acceptate și pe părțile redate.

Autocomplete.Root

RefObject<AutocompleteRootActions | null>
A ref to imperative actions.
  • unmount: Ends the closing phase of the autocomplete after an externally controlled closing animation finishes. Call preventUnmountOnClose() in onOpenChange first, otherwise the autocomplete completes closing on its own. Whether it leaves the DOM is decided by keepMounted on the portal.
  • close: Closes the autocomplete imperatively when called.
boolean | "always"
default:"false"
Whether the first matching item is highlighted automatically.
  • true: highlight after the user types and keep the highlight while the query changes.
  • 'always': always highlight the first item.
boolean
default:"false"
Whether the popup is initially open.To render a controlled popup, use the open prop instead.
string | number | readonly string[]
The uncontrolled input value of the autocomplete when it’s initially rendered.To render a controlled autocomplete, use the value prop instead.
boolean
default:"false"
Whether the component should ignore user interaction.
AutocompleteRootProps<TItem>["filter"]
Filter function used to match items against the input query.
readonly TItem[] | readonly { items: readonly TItem[] }[]
Filtered items to display in the list. When provided, the list uses these items instead of filtering the items prop internally. When items is also provided, this array must preserve its flat or grouped structure. Nullish entries are not supported, as in items. Use when you want to control filtering logic externally with the useFilter() hook.
string
Identifies the form that owns the internal input. Useful when the autocomplete is rendered outside the form.
boolean
default:"false"
Whether list items are presented in a grid layout. When enabled, arrow keys navigate across rows and columns inferred from DOM rows.
boolean
default:"true"
Whether moving the pointer over items should highlight them. Disabling this prop allows CSS :hover to be differentiated from the :focus (data-highlighted) state.
string
The id of the component.
boolean
default:"false"
Whether the list is rendered inline without using the component’s own popup.Specify open unconditionally in conjunction with this prop so the list is considered visible: <Autocomplete.Root inline open>
Ref<HTMLInputElement>
A ref to the hidden input element.
readonly TItem[] | readonly { items: readonly TItem[] }[]
Flat items or groups with an items array. Preserves the upstream item type; nullish entries are not supported.
(itemValue: TItem) => string
When the item values are objects (<Autocomplete.Item value={object}>), this function converts the object value to a string representation for both display in the input and form submission. If the shape of the object is { value, label }, the label will be used automatically without needing to specify this prop.
boolean
default:"false"
Whether the highlighted item should be preserved when the pointer leaves the list.
number
default:"-1"
The maximum number of items to display in the list.
LocalesArgument
The locale to use for string comparison. Defaults to the user’s runtime locale.
boolean
default:"true"
Whether to loop keyboard focus back to the input when the end of the list is reached while using the arrow keys. The first item can then be reached by pressing <kbd>ArrowDown</kbd> again from the input, or the last item can be reached by pressing <kbd>ArrowUp</kbd> from the input. The input is always included in the focus loop per ARIA Authoring Practices. When disabled, focus does not move when on the last element and the user presses <kbd>ArrowDown</kbd>, or when on the first element and the user presses <kbd>ArrowUp</kbd>.
boolean
default:"false"
Determines if the popup enters a modal state when open.
  • true: user interaction is limited to the popup: document page scroll is locked and pointer interactions on outside elements are disabled.
  • false: user interaction with the rest of the document is allowed.
On touch devices, a true modal blocks outside taps but leaves the page scrollable unless the popup spans nearly the full viewport width, matching native iOS behavior.
"both" | "inline" | "list" | "none"
default:"list"
Controls how the autocomplete behaves with respect to list filtering and inline autocompletion.
  • list (default): items are dynamically filtered based on the input value. The input value does not change based on the active item.
  • both: items are dynamically filtered based on the input value, which will temporarily change based on the active item (inline autocompletion).
  • inline: items are static (not filtered), and the input value will temporarily change based on the active item (inline autocompletion).
  • none: items are static (not filtered), and the input value will not change based on the active item.
string
Identifies the field when a form is submitted.
(highlightedValue: TItem | undefined, eventDetails: AutocompleteRootHighlightEventDetails) => void
Callback fired when an item is highlighted or unhighlighted. Receives the highlighted item value (or undefined if no item is highlighted) and event details with a reason property describing why the highlight changed. The reason can be:
  • 'keyboard': the highlight changed due to keyboard navigation.
  • 'pointer': the highlight changed due to pointer hovering. The event may be a MouseEvent rather than a PointerEvent.
  • 'none': the highlight changed for another reason, such as typing, autoHighlight, the item list changing, or the popup opening or closing.
((open: boolean, eventDetails: AutocompleteRootOpenChangeEventDetails) => void)
Event handler called when the popup is opened or closed.
((open: boolean) => void)
Event handler called after any animations complete when the popup is opened or closed.
((value: string, eventDetails: AutocompleteRootChangeEventDetails) => void)
Event handler called when the input value of the autocomplete changes.
boolean
Whether the popup is currently open. Use when controlled.
boolean
default:"false"
Whether the popup opens when clicking the input.
boolean
default:"false"
Whether the user should be unable to choose a different option from the popup.
boolean
default:"false"
Whether the user must choose a value before submitting a form.
boolean
default:"false"
Whether clicking an item should submit the autocomplete’s owning form. By default, clicking an item via a pointer or <kbd>Enter</kbd> key does not submit the owning form. Useful when the autocomplete is used as a single-field form search input.
string | number | readonly string[]
The input value of the autocomplete. Use when controlled.
boolean
default:"false"
Whether the items are being externally virtualized.

Autocomplete.Value

ReactNode | ((value: string) => ReactNode)
Content or render function receiving the current input text.

Autocomplete.Trigger

string | ((state: AutocompleteTriggerState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
boolean
default:"false"
Whether the component should ignore user interaction.
boolean
default:"true"
Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>).
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, AutocompleteTriggerState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
CSSProperties | ((state: AutocompleteTriggerState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.

Autocomplete.InputGroup

string | ((state: AutocompleteInputGroupState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, AutocompleteInputGroupState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
CSSProperties | ((state: AutocompleteInputGroupState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.

Autocomplete.Input

string | ((state: ComboboxInputState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
boolean
default:"false"
Whether the component should ignore user interaction.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxInputState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
"md" | "sm"
Visual size of the input. Inside an InputGroup, the group size applies. Not accepted with render.
CSSProperties | ((state: ComboboxInputState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.

Autocomplete.Icon

string | ((state: ComboboxIconState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxIconState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
CSSProperties | ((state: ComboboxIconState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.

Autocomplete.Clear

string | ((state: ComboboxClearState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
boolean
default:"false"
Whether the component should ignore user interaction.
boolean
default:"false"
Whether the component should remain mounted in the DOM when not visible.
boolean
default:"true"
Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>).
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxClearState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
CSSProperties | ((state: ComboboxClearState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.

Autocomplete.Portal

string | ((state: ComboboxPortalState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null
Portal destination. Omitted uses the scoped theme container; explicit null waits without rendering. Element, ShadowRoot and ref targets pass through to Base UI.
boolean
default:"false"
Whether to keep the portal mounted in the DOM while the popup is hidden.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxPortalState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
CSSProperties | ((state: ComboboxPortalState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.

Autocomplete.Backdrop

string | ((state: ComboboxBackdropState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxBackdropState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
CSSProperties | ((state: ComboboxBackdropState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.

Autocomplete.Positioner

"center" | "end" | "start"
default:"start"
Alignment relative to the anchor. Defaults to start.
number | OffsetFunction
default:"0"
Additional offset along the alignment axis in pixels. Also accepts a function that returns the offset to read the dimensions of the anchor and positioner elements, along with its side and alignment.The function takes a data object parameter with the following properties:
  • data.anchor: the dimensions of the anchor element with properties width and height.
  • data.positioner: the dimensions of the positioner element with properties width and height.
  • data.side: which side of the anchor element the positioner is aligned against.
  • data.align: how the positioner is aligned relative to the specified side.
Element | VirtualElement | RefObject<Element | null> | (() => Element | VirtualElement | null) | null
An element to position the popup against. By default, the popup will be positioned against the trigger.
number
default:"5"
Minimum distance to maintain between the arrow and the edges of the popup.Use it to prevent the arrow element from hanging out of the rounded corners of a popup.
string | ((state: ComboboxPositionerState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
CollisionAvoidance
Determines how to handle collisions when positioning the popup.side controls overflow on the preferred placement axis (top/bottom or left/right):
  • 'flip': keep the requested side when it fits; otherwise try the opposite side (top and bottom, or left and right).
  • 'shift': never change side; keep the requested side and move the popup within the clipping boundary so it stays visible.
  • 'none': do not correct side-axis overflow.
align controls overflow on the alignment axis (start/center/end):
  • 'flip': keep side, but swap start and end when the requested alignment overflows.
  • 'shift': keep side and requested alignment, then nudge the popup along the alignment axis to fit.
  • 'none': do not correct alignment-axis overflow.
fallbackAxisSide controls fallback behavior on the perpendicular axis when the preferred axis cannot fit:
  • 'start': allow perpendicular fallback and try the logical start side first (top before bottom, or left before right in LTR).
  • 'end': allow perpendicular fallback and try the logical end side first (bottom before top, or right before left in LTR).
  • 'none': do not fallback to the perpendicular axis.
When side is 'shift', explicitly setting align only supports 'shift' or 'none'. If align is omitted, it defaults to 'flip'.
Boundary
default:"clipping-ancestors"
An element or a rectangle that delimits the area that the popup is confined to.
Padding
default:"5"
Additional space to maintain from the edge of the collision boundary.
boolean
default:"false"
Whether to disable the popup from tracking any layout shift of its positioning anchor.
"absolute" | "fixed"
default:"absolute"
Determines which CSS position property to use.
Ref<HTMLDivElement>
Ref to the positioning div, separate from Popup and Portal.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxPositionerState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
"bottom" | "inline-end" | "inline-start" | "left" | "right" | "top"
default:"bottom"
Which side of the anchor element to align the popup against. May automatically change to avoid collisions.
number | OffsetFunction
default:"8"
Distance from the anchor. Defaults to 8; supports functional offsets.
boolean
default:"false"
Whether to maintain the popup in the viewport after the anchor element was scrolled out of view.
CSSProperties | ((state: ComboboxPositionerState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.

Autocomplete.Popup

string | ((state: ComboboxPopupState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | void | HTMLElement | null)
Determines the element to focus when the popup is closed.
  • false: Do not move focus.
  • true: Move focus based on the default behavior (trigger or previously focused element).
  • RefObject: Move focus to the ref element.
  • function: Called with the interaction type (mouse, touch, pen, or keyboard). Return an element to focus, true to use the default behavior, or false/undefined to do nothing.
boolean | RefObject<HTMLElement | null> | ((openType: InteractionType) => boolean | void | HTMLElement | null)
Determines the element to focus when the popup is opened.
  • false: Do not move focus.
  • true: Move focus based on the default behavior (first tabbable element or popup).
  • RefObject: Move focus to the ref element.
  • function: Called with the interaction type (mouse, touch, pen, or keyboard). Return an element to focus, true to use the default behavior, or false/undefined to do nothing.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxPopupState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
CSSProperties | ((state: ComboboxPopupState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.
string | number
Width of the popup. Overrides its default minimum anchor width.

Autocomplete.Arrow

string | ((state: ComboboxArrowState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxArrowState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
CSSProperties | ((state: ComboboxArrowState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.

Autocomplete.List

string | ((state: ComboboxListState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxListState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
CSSProperties | ((state: ComboboxListState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.

Autocomplete.Status

string | ((state: ComboboxStatusState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxStatusState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
CSSProperties | ((state: ComboboxStatusState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.

Autocomplete.Group

string | ((state: ComboboxGroupState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
readonly any[]
Items to be rendered within this group. When provided, child Collection components will use these items.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxGroupState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
CSSProperties | ((state: ComboboxGroupState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.

Autocomplete.GroupLabel

string | ((state: ComboboxGroupLabelState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxGroupLabelState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
CSSProperties | ((state: ComboboxGroupLabelState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.

Autocomplete.Item

string | ((state: AutocompleteItemState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
ReactNode
Supporting text, placed according to descriptionPlacement.
"end" | "inline"
default:"inline"
Where the description renders: inline after the content or at the end of the row.
boolean
default:"false"
Whether the component should ignore user interaction.
ReactNode
Icon rendered after the content.
number
The index of the item in the list. Improves performance when specified by avoiding the need to calculate the index automatically from the DOM.
boolean
default:"false"
Whether the component renders a native <button> element when replacing it via the render prop. Set to true if the rendered element is a native button.
((event: BaseUIEvent<MouseEvent<HTMLDivElement, MouseEvent>>) => void)
An optional click handler for the item when selected. It fires when clicking the item with the pointer, as well as when pressing Enter with the keyboard if the item is highlighted when the Input or List element has focus.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, AutocompleteItemState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
ReactNode
Icon rendered before the content.
CSSProperties | ((state: AutocompleteItemState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.
any
default:"null"
A unique value that identifies this item.

Autocomplete.Row

string | ((state: ComboboxRowState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxRowState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
CSSProperties | ((state: ComboboxRowState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.

Autocomplete.Collection

(item: any, index: number) => ReactNode
required
Render function receiving each filtered item and its index.

Autocomplete.Empty

string | ((state: ComboboxEmptyState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxEmptyState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
CSSProperties | ((state: ComboboxEmptyState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.

Autocomplete.Separator

string | ((state: AutocompleteSeparatorState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
"horizontal" | "vertical"
default:"horizontal"
The orientation of the separator.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, AutocompleteSeparatorState>
Allows you to replace the component’s HTML element with a different tag, or compose it with another component.Accepts a ReactElement or a function that returns the element to render.
CSSProperties | ((state: AutocompleteSeparatorState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.