> ## Documentation Index
> Fetch the complete documentation index at: https://docs.twenty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Autocomplete

> Suggest values while the user types and keeps focus in the input.

export const StoryEmbed = ({storyId, title, height = 120}) => <>
    <Tabs>
      <Tab title="Light">
        <iframe title={`${title} (light)`} src={`https://storybook.twenty.com/iframe.html?id=${storyId}&viewMode=story&globals=colorScheme:light`} width="100%" height={height} loading="lazy" allow="clipboard-write" style={{
  border: 0
}} />
      </Tab>
      <Tab title="Dark">
        <iframe title={`${title} (dark)`} src={`https://storybook.twenty.com/iframe.html?id=${storyId}&viewMode=story&globals=colorScheme:dark`} width="100%" height={height} loading="lazy" allow="clipboard-write" style={{
  border: 0
}} />
      </Tab>
    </Tabs>
    <a href={`https://storybook.twenty.com/?path=/story/${storyId}`}>
      Open in Storybook
    </a>
  </>;

Use `Autocomplete` for suggestions attached to a text input. The input keeps its caret and keyboard focus while arrow keys highlight suggestions. Use [Select](/ui/primitives/input/select) when the user must choose a value from a fixed list. [Dropdown](/ui/components/navigation/dropdown) remains the higher-level component for menus and pickers.

<StoryEmbed storyId="ui-input-autocomplete--display" title="Autocomplete example" height={360} />

## Usage

Pass `items` to `Root` and render them through `List` so filtering updates the visible suggestions. `autoHighlight="always"` highlights the first result whenever the list opens.

```tsx theme={null}
import { Autocomplete } from 'twenty-ui/primitives/input';

const FRUITS = ['Apple', 'Banana', 'Cherry'];

export const FruitInput = () => (
  <Autocomplete.Root items={FRUITS} autoHighlight="always">
    <Autocomplete.InputGroup>
      <Autocomplete.Input aria-label="Fruit" placeholder="Search fruits" />
    </Autocomplete.InputGroup>
    <Autocomplete.Portal>
      <Autocomplete.Positioner>
        <Autocomplete.Popup>
          <Autocomplete.Empty>No fruits found</Autocomplete.Empty>
          <Autocomplete.List>
            {(fruit: string) => (
              <Autocomplete.Item key={fruit} value={fruit}>
                {fruit}
              </Autocomplete.Item>
            )}
          </Autocomplete.List>
        </Autocomplete.Popup>
      </Autocomplete.Positioner>
    </Autocomplete.Portal>
  </Autocomplete.Root>
);
```

`value` and `onValueChange` control the input text. Use `defaultValue` for an uncontrolled initial value. Open state is independent: use `open` and `onOpenChange`, or `defaultOpen`. `Item.onClick` handles both pointer selection and Enter from the input.

`mode="list"` filters without changing input text on highlight. `mode="both"` also supplies inline completion. `mode="inline"` keeps all items and supplies inline completion; `mode="none"` keeps all items without inline completion. `readOnly` prevents inline completion from changing the input.

## Anatomy

Keep related parts inside a mounted `Autocomplete.Root`. Compose the portal destination, positioning wrapper, and content separately. `InputGroup` optionally groups the input with adjacent controls and anchors the popup to that group.

```text theme={null}
Autocomplete.Root
├── Autocomplete.InputGroup (optional)
│   ├── Autocomplete.Input
│   ├── Autocomplete.Clear (optional)
│   └── Autocomplete.Trigger (optional)
│       └── Autocomplete.Icon (optional)
├── Autocomplete.Portal
│   ├── Autocomplete.Backdrop (optional)
│   └── Autocomplete.Positioner
│       └── Autocomplete.Popup
│           ├── Autocomplete.Arrow (optional)
│           ├── Autocomplete.Empty
│           └── Autocomplete.List
│               ├── Autocomplete.Item
│               ├── Autocomplete.Group (optional)
│               │   ├── Autocomplete.GroupLabel
│               │   └── Autocomplete.Collection
│               │       └── Autocomplete.Item
│               ├── Autocomplete.Row (optional, with Root.grid)
│               │   └── Autocomplete.Item
│               └── Autocomplete.Separator (optional)
├── Autocomplete.Status (optional)
└── Autocomplete.Value (optional)
```

| Part | Purpose and native target |
| - | - |
| `Root` | Owns input value, filtering, highlights, and open state. Renders no element. |
| `Value` | Reads the input text through children or a render function. Renders no element. |
| `InputGroup` | Groups the input and adjacent controls. Targets a div. |
| `Input` | Renders the combobox input and retains keyboard focus. Targets an input. |
| `Trigger` | Opens or closes suggestions. Targets a button. |
| `Icon` | Contains a trigger indicator. Targets a span. |
| `Clear` | Clears the input value. Targets a button. |
| `Portal` | Chooses the destination and mounting policy. Targets its portal div. |
| `Backdrop` | Supplies an optional overlay beneath the popup. Targets a div. |
| `Positioner` | Owns anchor, alignment, offsets, and collision handling. Targets its div. |
| `Popup` | Renders the suggestion content and optional focus behavior. Targets its div. |
| `Arrow` | Supplies an optional positioned arrow inside Popup. Targets a div. |
| `List` | Renders filtered items. Targets a div with the listbox or grid role. |
| `Item` | Renders a suggestion and handles pointer or keyboard selection. Targets a div. |
| `Group` | Groups related items. Targets a div. |
| `GroupLabel` | Labels its parent group. Targets a div. |
| `Row` | Groups a row of items when `Root.grid` is enabled. Targets a div. |
| `Collection` | Renders filtered items through a function child. Renders no element. |
| `Separator` | Separates items or groups visually. Targets a div. |
| `Empty` | Announces when no matching items are available. Targets a div. |
| `Status` | Announces changes such as asynchronous loading status. Targets a div. |

Rendered parts retain native attributes, handlers, refs, state-based `className` and `style`, and element/function `render` composition from the installed Base UI API. Native props and refs target the part's own element. Custom components must forward supplied props and refs. Public part props and state types are exported from `twenty-ui/primitives/input`, together with Root actions and change/highlight event detail types.

`Autocomplete.useFilter()` supplies locale-aware `contains`, `startsWith`, and `endsWith` matching. `Autocomplete.useFilteredItems<TItem>()` reads the internally filtered collection under Root. Treat that result as read-only.

## Object and grouped items

Items can be strings or arbitrary objects. Use `itemToStringValue` to supply the text used for filtering, completion, and form submission. Objects shaped as `{ value, label }` use their label automatically. Render the same item value supplied through Root; no Twenty-specific item shape or selection equality prop is required. Autocomplete owns text input rather than a separate selected object value.

For grouped data, pass groups with an `items` array. Root preserves the item type for `itemToStringValue` and `onItemHighlighted`. Render each group's filtered children through `Group` and `Collection`:

```tsx theme={null}
import { Autocomplete } from 'twenty-ui/primitives/input';
import { Text } from 'twenty-ui/primitives/typography';

type City = { id: number; name: string; country: string };
type CityGroup = { label: string; items: City[] };

const CITY_GROUPS: CityGroup[] = [
  {
    label: 'Europe',
    items: [
      { id: 1, name: 'Paris', country: 'France' },
      { id: 2, name: 'Lisbon', country: 'Portugal' },
    ],
  },
];

export const GroupedCityInput = () => (
  <Text
    style={{ display: 'grid', alignContent: 'start', gap: 8, width: '100%' }}
  >
    <label htmlFor="grouped-city">
      <Text render={<span />}>City</Text>
    </label>
    <Autocomplete.Root
      items={CITY_GROUPS}
      itemToStringValue={(city) => city.name}
      autoHighlight="always"
    >
      <Autocomplete.Input id="grouped-city" placeholder="Search cities" />
      <Autocomplete.Portal>
        <Autocomplete.Positioner>
          <Autocomplete.Popup>
            <Autocomplete.Empty>No matching cities</Autocomplete.Empty>
            <Autocomplete.List>
              {(group: CityGroup) => (
                <Autocomplete.Group key={group.label} items={group.items}>
                  <Autocomplete.GroupLabel>
                    {group.label}
                  </Autocomplete.GroupLabel>
                  <Autocomplete.Collection>
                    {(city: City) => (
                      <Autocomplete.Item
                        key={city.id}
                        value={city}
                        description={city.country}
                      >
                        {city.name}
                      </Autocomplete.Item>
                    )}
                  </Autocomplete.Collection>
                </Autocomplete.Group>
              )}
            </Autocomplete.List>
          </Autocomplete.Popup>
        </Autocomplete.Positioner>
      </Autocomplete.Portal>
    </Autocomplete.Root>
  </Text>
);
```

<StoryEmbed storyId="ui-input-autocomplete-collections--grouped-objects" title="Grouped object suggestions" height={440} />

`Item.startIcon`, `Item.endIcon`, and `Item.description` provide supporting content. Compose `Trigger` and `Clear` with Twenty UI [Button](/ui/primitives/input/button) through `render`. `Icon` can contain an icon from `twenty-ui/icon`. Keep `Status` and `Empty` mounted while updating their children so screen readers can announce changes.

## External filtering and server suggestions

Use `filteredItems` when your application owns filtering. It must preserve the flat or grouped structure of `items`. `filter` accepts a custom matching function; `filter={null}` disables internal filtering for results already filtered by a server.

```tsx theme={null}
import { useState } from 'react';
import { Autocomplete } from 'twenty-ui/primitives/input';

const CITIES = ['Paris', 'London', 'Lisbon'];

export const CityPrefixInput = () => {
  const [value, setValue] = useState('');
  const { startsWith } = Autocomplete.useFilter();
  const filteredItems = CITIES.filter((city) => startsWith(city, value));

  return (
    <Autocomplete.Root
      items={CITIES}
      filteredItems={filteredItems}
      value={value}
      onValueChange={setValue}
      autoHighlight="always"
    >
      <Autocomplete.Input aria-label="City prefix" />
      <Autocomplete.Portal>
        <Autocomplete.Positioner>
          <Autocomplete.Popup>
            <Autocomplete.Empty>No matching cities</Autocomplete.Empty>
            <Autocomplete.List>
              {(city: string) => (
                <Autocomplete.Item key={city} value={city}>
                  {city}
                </Autocomplete.Item>
              )}
            </Autocomplete.List>
          </Autocomplete.Popup>
        </Autocomplete.Positioner>
      </Autocomplete.Portal>
    </Autocomplete.Root>
  );
};
```

Keep Root mounted when results arrive asynchronously. Control `open` independently so a response can open suggestions while the input remains focused. A mounted `Status` can announce loading; update `Empty` when the completed response has no results. The parent owns debounce, request cancellation, and stale response protection.

`onValueChange` and `onOpenChange` receive the upstream event details, including `reason`, native `event`, `trigger`, `cancel()`, and `allowPropagation()`. Controlled callers decide which requested updates to commit. For example, ignore the `escape-key` value change to keep a server query, or ignore `input-change` opening until results arrive. `onItemHighlighted` receives the original typed item and its highlight reason. Cancellation keeps the installed Base UI semantics; it does not replace the application's controlled-state policy.

## Input composition and native forms

`Input` accepts `size="sm"` or `size="md"` and uses the same styles as [Input](/ui/primitives/input/input). Compose it with an existing input using `render`. The composed control then owns its look: `Input` adds no Input styles and ignores `size`, but still passes your `className`, native attributes, handlers, ref, and state attributes. Forward them to the actual input element. Render Twenty UI `Input` to keep the standard look.

`InputGroup` provides layout and an anchor without adding input borders. It can contain chips or render an existing wrapper. Use [InputGroup](/ui/primitives/input/input-group) through its `render` prop when the whole group needs input styling, as the grouped object suggestions story does. An `Input` without `render` inside it drops its own border. Give the input an accessible label or compose it with [Field](/ui/primitives/input/field).

Root preserves the upstream `name`, `form`, `disabled`, `readOnly`, and native form behavior. Input's native attributes and ref target its input. `submitOnItemClick` opts into form submission when selecting a suggestion; the default does not submit.

Input preserves Base UI's native IME handling, including composition events and its keyboard confirmation guard.

The installed Base UI version retains an uncontrolled query on native form reset. For a controlled query, handle the form's `onReset` and restore the application's initial value.

## Placement, portal destination, and dismissal

`Positioner` defaults to `side="bottom"`, `align="start"`, and `sideOffset={8}`. It retains the installed Base UI anchor and positioning contract, including element/ref/function/virtual anchors, functional offsets, `positionMethod`, `collisionBoundary`, `collisionPadding`, `collisionAvoidance`, `arrowPadding`, `sticky`, and `disableAnchorTracking`. Configure these on Positioner. DirectionProvider controls logical placement and DOM direction.

`Popup` uses the anchor width as its minimum width. Set its `width` to supply a fixed content width. Its native props, styles, render composition, and ref target the content element independently of Positioner and Portal. Popup's `initialFocus` and `finalFocus` retain upstream focus options. By default, suggestions keep focus in the input.

Configure `container` and `keepMounted` on `Portal`. Omitting the container uses the nearest scoped ThemeProvider destination, then Base UI's parent portal or document body. An explicit `null` waits without rendering until a container is supplied. Element, ShadowRoot, and ref destinations pass through to Base UI. An unresolved ref retains Base UI's parent-portal/body fallback.

The default scoped destination preserves its CSS tokens and color scheme. An explicit destination inherits CSS from its actual DOM scope, so place it inside the intended theme scope or supply those styles there. React context and direction remain available across portals. ShadowRoot targets need the library's CSS and theme styles in that shadow tree.

Arrow keys change the highlighted item while the input keeps focus. Enter selects it; Escape and outside interaction request dismissal using upstream semantics. An outside press can activate the destination control. Higher-level pickers can own a different activation policy in their adapter. Call `event.preventBaseUIHandler()` in Input's `onKeyDown` to skip the built-in handler for a key you handle yourself. Use `event.preventDefault()` as well when suppressing the browser's native action.

`Root.inline` with `open` renders suggestions without the popup assembly. Inline items retain their `onClick` selection callbacks, but the installed upstream component fills the input automatically only when its Popup is present. Handle `Item.onClick` when inline selection should update your controlled text. `Root.grid` and `Row` support grid navigation. These modes retain the upstream collection and rendering APIs.

## Migration

Wrap Popup with `Autocomplete.Positioner` and `Autocomplete.Portal`. Positioner requires the Portal context; inline suggestions omit the whole popup assembly. Move placement, anchor, and collision props from Popup to Positioner. Move `container` and mounting configuration to Portal. Keep width, content styles, native props, handlers, and refs on Popup. Use an explicit `Arrow` child for an arrow.

Inside front components, keep the existing scoped portal policy. This API does not expand renderer portal destinations or geometry, scrolling, and dismissal capabilities; those renderer capabilities have separate ownership. Production picker adapters retain their deliberate activation workflows.

## Props

The reference is generated from the public component types. Native attributes, accessible names, and event handlers are also accepted on rendered parts.

### Autocomplete.Root

<ParamField body="Root.actionsRef" type="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.
</ParamField>

<ParamField body="Root.autoHighlight" type="boolean | &#x22;always&#x22;" 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.
</ParamField>

<ParamField body="Root.defaultOpen" type="boolean" default="false">
  Whether the popup is initially open.

  To render a controlled popup, use the `open` prop instead.
</ParamField>

<ParamField body="Root.defaultValue" type="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.
</ParamField>

<ParamField body="Root.disabled" type="boolean" default="false">
  Whether the component should ignore user interaction.
</ParamField>

<ParamField body="Root.filter" type="AutocompleteRootProps<TItem>[&#x22;filter&#x22;]">
  Filter function used to match items against the input query.
</ParamField>

<ParamField body="Root.filteredItems" type="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.
</ParamField>

<ParamField body="Root.form" type="string">
  Identifies the form that owns the internal input.
  Useful when the autocomplete is rendered outside the form.
</ParamField>

<ParamField body="Root.grid" type="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.
</ParamField>

<ParamField body="Root.highlightItemOnHover" type="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.
</ParamField>

<ParamField body="Root.id" type="string">
  The id of the component.
</ParamField>

<ParamField body="Root.inline" type="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>`
</ParamField>

<ParamField body="Root.inputRef" type="Ref<HTMLInputElement>">
  A ref to the hidden input element.
</ParamField>

<ParamField body="Root.items" type="readonly TItem[] | readonly { items: readonly TItem[] }[]">
  Flat items or groups with an items array. Preserves the upstream item type; nullish entries are not supported.
</ParamField>

<ParamField body="Root.itemToStringValue" type="(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.
</ParamField>

<ParamField body="Root.keepHighlight" type="boolean" default="false">
  Whether the highlighted item should be preserved when the pointer leaves the list.
</ParamField>

<ParamField body="Root.limit" type="number" default="-1">
  The maximum number of items to display in the list.
</ParamField>

<ParamField body="Root.locale" type="LocalesArgument">
  The locale to use for string comparison.
  Defaults to the user's runtime locale.
</ParamField>

<ParamField body="Root.loopFocus" type="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](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/).
  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>.
</ParamField>

<ParamField body="Root.modal" type="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.
</ParamField>

<ParamField body="Root.mode" type="&#x22;both&#x22; | &#x22;inline&#x22; | &#x22;list&#x22; | &#x22;none&#x22;" 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.
</ParamField>

<ParamField body="Root.name" type="string">
  Identifies the field when a form is submitted.
</ParamField>

<ParamField body="Root.onItemHighlighted" type="(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.
</ParamField>

<ParamField body="Root.onOpenChange" type="((open: boolean, eventDetails: AutocompleteRootOpenChangeEventDetails) => void)">
  Event handler called when the popup is opened or closed.
</ParamField>

<ParamField body="Root.onOpenChangeComplete" type="((open: boolean) => void)">
  Event handler called after any animations complete when the popup is opened or closed.
</ParamField>

<ParamField body="Root.onValueChange" type="((value: string, eventDetails: AutocompleteRootChangeEventDetails) => void)">
  Event handler called when the input value of the autocomplete changes.
</ParamField>

<ParamField body="Root.open" type="boolean">
  Whether the popup is currently open. Use when controlled.
</ParamField>

<ParamField body="Root.openOnInputClick" type="boolean" default="false">
  Whether the popup opens when clicking the input.
</ParamField>

<ParamField body="Root.readOnly" type="boolean" default="false">
  Whether the user should be unable to choose a different option from the popup.
</ParamField>

<ParamField body="Root.required" type="boolean" default="false">
  Whether the user must choose a value before submitting a form.
</ParamField>

<ParamField body="Root.submitOnItemClick" type="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.
</ParamField>

<ParamField body="Root.value" type="string | number | readonly string[]">
  The input value of the autocomplete. Use when controlled.
</ParamField>

<ParamField body="Root.virtualized" type="boolean" default="false">
  Whether the items are being externally virtualized.
</ParamField>

### Autocomplete.Value

<ParamField body="Value.children" type="ReactNode | ((value: string) => ReactNode)">
  Content or render function receiving the current input text.
</ParamField>

### Autocomplete.Trigger

<ParamField body="Trigger.className" type="string | ((state: AutocompleteTriggerState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Trigger.disabled" type="boolean" default="false">
  Whether the component should ignore user interaction.
</ParamField>

<ParamField body="Trigger.nativeButton" type="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>`).
</ParamField>

<ParamField body="Trigger.render" type="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.
</ParamField>

<ParamField body="Trigger.style" type="CSSProperties | ((state: AutocompleteTriggerState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Autocomplete.InputGroup

<ParamField body="InputGroup.className" type="string | ((state: AutocompleteInputGroupState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="InputGroup.render" type="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.
</ParamField>

<ParamField body="InputGroup.style" type="CSSProperties | ((state: AutocompleteInputGroupState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Autocomplete.Input

<ParamField body="Input.className" type="string | ((state: ComboboxInputState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Input.disabled" type="boolean" default="false">
  Whether the component should ignore user interaction.
</ParamField>

<ParamField body="Input.render" type="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.
</ParamField>

<ParamField body="Input.size" type="&#x22;md&#x22; | &#x22;sm&#x22;">
  Visual size of the input. Inside an InputGroup, the group size applies. Not accepted with render.
</ParamField>

<ParamField body="Input.style" type="CSSProperties | ((state: ComboboxInputState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Autocomplete.Icon

<ParamField body="Icon.className" type="string | ((state: ComboboxIconState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Icon.render" type="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.
</ParamField>

<ParamField body="Icon.style" type="CSSProperties | ((state: ComboboxIconState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Autocomplete.Clear

<ParamField body="Clear.className" type="string | ((state: ComboboxClearState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Clear.disabled" type="boolean" default="false">
  Whether the component should ignore user interaction.
</ParamField>

<ParamField body="Clear.keepMounted" type="boolean" default="false">
  Whether the component should remain mounted in the DOM when not visible.
</ParamField>

<ParamField body="Clear.nativeButton" type="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>`).
</ParamField>

<ParamField body="Clear.render" type="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.
</ParamField>

<ParamField body="Clear.style" type="CSSProperties | ((state: ComboboxClearState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Autocomplete.Portal

<ParamField body="Portal.className" type="string | ((state: ComboboxPortalState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Portal.container" type="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.
</ParamField>

<ParamField body="Portal.keepMounted" type="boolean" default="false">
  Whether to keep the portal mounted in the DOM while the popup is hidden.
</ParamField>

<ParamField body="Portal.render" type="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.
</ParamField>

<ParamField body="Portal.style" type="CSSProperties | ((state: ComboboxPortalState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Autocomplete.Backdrop

<ParamField body="Backdrop.className" type="string | ((state: ComboboxBackdropState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Backdrop.render" type="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.
</ParamField>

<ParamField body="Backdrop.style" type="CSSProperties | ((state: ComboboxBackdropState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Autocomplete.Positioner

<ParamField body="Positioner.align" type="&#x22;center&#x22; | &#x22;end&#x22; | &#x22;start&#x22;" default="start">
  Alignment relative to the anchor. Defaults to start.
</ParamField>

<ParamField body="Positioner.alignOffset" type="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.
</ParamField>

<ParamField body="Positioner.anchor" type="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.
</ParamField>

<ParamField body="Positioner.arrowPadding" type="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.
</ParamField>

<ParamField body="Positioner.className" type="string | ((state: ComboboxPositionerState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Positioner.collisionAvoidance" type="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'`.
</ParamField>

<ParamField body="Positioner.collisionBoundary" type="Boundary" default="clipping-ancestors">
  An element or a rectangle that delimits the area that the popup is confined to.
</ParamField>

<ParamField body="Positioner.collisionPadding" type="Padding" default="5">
  Additional space to maintain from the edge of the collision boundary.
</ParamField>

<ParamField body="Positioner.disableAnchorTracking" type="boolean" default="false">
  Whether to disable the popup from tracking any layout shift of its positioning anchor.
</ParamField>

<ParamField body="Positioner.positionMethod" type="&#x22;absolute&#x22; | &#x22;fixed&#x22;" default="absolute">
  Determines which CSS `position` property to use.
</ParamField>

<ParamField body="Positioner.ref" type="Ref<HTMLDivElement>">
  Ref to the positioning div, separate from Popup and Portal.
</ParamField>

<ParamField body="Positioner.render" type="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.
</ParamField>

<ParamField body="Positioner.side" type="&#x22;bottom&#x22; | &#x22;inline-end&#x22; | &#x22;inline-start&#x22; | &#x22;left&#x22; | &#x22;right&#x22; | &#x22;top&#x22;" default="bottom">
  Which side of the anchor element to align the popup against.
  May automatically change to avoid collisions.
</ParamField>

<ParamField body="Positioner.sideOffset" type="number | OffsetFunction" default="8">
  Distance from the anchor. Defaults to 8; supports functional offsets.
</ParamField>

<ParamField body="Positioner.sticky" type="boolean" default="false">
  Whether to maintain the popup in the viewport after
  the anchor element was scrolled out of view.
</ParamField>

<ParamField body="Positioner.style" type="CSSProperties | ((state: ComboboxPositionerState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Autocomplete.Popup

<ParamField body="Popup.className" type="string | ((state: ComboboxPopupState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Popup.finalFocus" type="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.
</ParamField>

<ParamField body="Popup.initialFocus" type="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.
</ParamField>

<ParamField body="Popup.render" type="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.
</ParamField>

<ParamField body="Popup.style" type="CSSProperties | ((state: ComboboxPopupState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

<ParamField body="Popup.width" type="string | number">
  Width of the popup. Overrides its default minimum anchor width.
</ParamField>

### Autocomplete.Arrow

<ParamField body="Arrow.className" type="string | ((state: ComboboxArrowState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Arrow.render" type="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.
</ParamField>

<ParamField body="Arrow.style" type="CSSProperties | ((state: ComboboxArrowState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Autocomplete.List

<ParamField body="List.className" type="string | ((state: ComboboxListState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="List.render" type="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.
</ParamField>

<ParamField body="List.style" type="CSSProperties | ((state: ComboboxListState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Autocomplete.Status

<ParamField body="Status.className" type="string | ((state: ComboboxStatusState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Status.render" type="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.
</ParamField>

<ParamField body="Status.style" type="CSSProperties | ((state: ComboboxStatusState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Autocomplete.Group

<ParamField body="Group.className" type="string | ((state: ComboboxGroupState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Group.items" type="readonly any[]">
  Items to be rendered within this group.
  When provided, child `Collection` components will use these items.
</ParamField>

<ParamField body="Group.render" type="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.
</ParamField>

<ParamField body="Group.style" type="CSSProperties | ((state: ComboboxGroupState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Autocomplete.GroupLabel

<ParamField body="GroupLabel.className" type="string | ((state: ComboboxGroupLabelState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="GroupLabel.render" type="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.
</ParamField>

<ParamField body="GroupLabel.style" type="CSSProperties | ((state: ComboboxGroupLabelState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Autocomplete.Item

<ParamField body="Item.className" type="string | ((state: AutocompleteItemState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Item.description" type="ReactNode">
  Supporting text, placed according to `descriptionPlacement`.
</ParamField>

<ParamField body="Item.descriptionPlacement" type="&#x22;end&#x22; | &#x22;inline&#x22;" default="inline">
  Where the description renders: inline after the content or at the end of
  the row.
</ParamField>

<ParamField body="Item.disabled" type="boolean" default="false">
  Whether the component should ignore user interaction.
</ParamField>

<ParamField body="Item.endIcon" type="ReactNode">
  Icon rendered after the content.
</ParamField>

<ParamField body="Item.index" type="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.
</ParamField>

<ParamField body="Item.nativeButton" type="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.
</ParamField>

<ParamField body="Item.onClick" type="((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.
</ParamField>

<ParamField body="Item.render" type="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.
</ParamField>

<ParamField body="Item.startIcon" type="ReactNode">
  Icon rendered before the content.
</ParamField>

<ParamField body="Item.style" type="CSSProperties | ((state: AutocompleteItemState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

<ParamField body="Item.value" type="any" default="null">
  A unique value that identifies this item.
</ParamField>

### Autocomplete.Row

<ParamField body="Row.className" type="string | ((state: ComboboxRowState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Row.render" type="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.
</ParamField>

<ParamField body="Row.style" type="CSSProperties | ((state: ComboboxRowState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Autocomplete.Collection

<ParamField body="Collection.children" type="(item: any, index: number) => ReactNode" required>
  Render function receiving each filtered item and its index.
</ParamField>

### Autocomplete.Empty

<ParamField body="Empty.className" type="string | ((state: ComboboxEmptyState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Empty.render" type="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.
</ParamField>

<ParamField body="Empty.style" type="CSSProperties | ((state: ComboboxEmptyState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>

### Autocomplete.Separator

<ParamField body="Separator.className" type="string | ((state: AutocompleteSeparatorState) => string | undefined)">
  CSS class applied to the element, or a function that
  returns a class based on the component's state.
</ParamField>

<ParamField body="Separator.orientation" type="&#x22;horizontal&#x22; | &#x22;vertical&#x22;" default="horizontal">
  The orientation of the separator.
</ParamField>

<ParamField body="Separator.render" type="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.
</ParamField>

<ParamField body="Separator.style" type="CSSProperties | ((state: AutocompleteSeparatorState) => CSSProperties | undefined)">
  Style applied to the element, or a function that
  returns a style object based on the component's state.
</ParamField>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.