@fayegram-ai/faye-ui/controls/autocomplete
Public exports and dependency-resolved component properties, with usage and rendering guidance.
Import
import { Autocomplete } from '@fayegram-ai/faye-ui/controls/autocomplete';Usage and behavior guide · API JSON
This entry declares a client boundary. Follow the rendering guide for framework integration.
Public exports
| Name | Kind | Resolved declaration type |
|---|---|---|
Autocomplete | value | { readonly Root: typeof Base.Root; readonly List: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompleteListProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>; readonly Collection: typeof Base.Collection; readonly Value: typeof Base.Value; readonly useFilter: typeof import("@base-ui/react/internals/filter").getFilter; readonly useFilteredItems: typeof Base.useFilteredItems; readonly Portal: typeof Portal; readonly Input: { (input: Omit<import("@base-ui/react").AutocompleteInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement> & { variants?: { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-var… (full type in API JSON) |
Autocomplete
Public component; use the linked family guide for complete composition and behavior.
Dependency-resolved declaration properties. Common React/native HTML attributes are omitted from the table; use the full declaration and React/native references. Generic and union restrictions remain authoritative in TypeScript.
Autocomplete.Root
| Property | Required | Type | Meaning |
|---|---|---|---|
actionsRef | No | React.RefObject<AutocompleteRootActions | null> | undefined | A ref to imperative actions. - unmount: Manually unmounts the autocomplete. Call this after any externally controlled closing animation finishes. |
autoHighlight | No | boolean | "always" | undefined | 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. |
children | No | React.ReactNode | See the usage contract and declaration. |
defaultOpen | No | boolean | undefined | Whether the popup is initially open. To render a controlled popup, use the open prop instead. |
defaultValue | No | string | number | readonly string[] | undefined | The uncontrolled input value of the autocomplete when it's initially rendered. To render a controlled autocomplete, use the value prop instead. |
disabled | No | boolean | undefined | Whether the component should ignore user interaction. |
filter | No | ((item: Items[number]["items"][number], query: string, itemToString?: ((item: Items[number]["items"][number]) => string) | undefined) => boolean) | null | undefined | Filter function used to match items against the input query. |
filteredItems | No | readonly Items[number]["items"][number][] | readonly Group<Items[number]["items"][number]>[] | undefined | 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. |
form | No | string | undefined | Identifies the form that owns the internal input. Useful when the autocomplete is rendered outside the form. |
grid | No | boolean | undefined | Whether list items are presented in a grid layout. When enabled, arrow keys navigate across rows and columns inferred from DOM rows. |
highlightItemOnHover | No | boolean | undefined | Whether moving the pointer over items should highlight them. Disabling this prop allows CSS :hover to be differentiated from the :focus (data-highlighted) state. |
id | No | string | undefined | The id of the component. |
inline | No | boolean | undefined | 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> |
inputRef | No | React.Ref<HTMLInputElement> | undefined | A ref to the hidden input element. |
items | Yes | Items | The items to be displayed in the list. Can be either a flat array of items or an array of groups with items. Nullish entries are not supported: remove them from the data before passing it. |
itemToStringValue | No | ((itemValue: Items[number]["items"][number]) => string) | undefined | 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. |
keepHighlight | No | boolean | undefined | Whether the highlighted item should be preserved when the pointer leaves the list. |
limit | No | number | undefined | The maximum number of items to display in the list. |
locale | No | Intl.LocalesArgument | The locale to use for string comparison. Defaults to the user's runtime locale. |
loopFocus | No | boolean | undefined | 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>. |
modal | No | boolean | undefined | 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. |
mode | No | "list" | "none" | "inline" | "both" | undefined | 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. |
name | No | string | undefined | Identifies the field when a form is submitted. |
onItemHighlighted | No | ((highlightedValue: Items[number]["items"][number] | undefined, eventDetails: AutocompleteRootHighlightEventDetails) => void) | undefined | 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. - 'none': the highlight changed programmatically. |
onOpenChange | No | ((open: boolean, eventDetails: AutocompleteRootChangeEventDetails) => void) | undefined | Event handler called when the popup is opened or closed. |
onOpenChangeComplete | No | ((open: boolean) => void) | undefined | Event handler called after any animations complete when the popup is opened or closed. |
onValueChange | No | ((value: string, eventDetails: AutocompleteRootChangeEventDetails) => void) | undefined | Event handler called when the input value of the autocomplete changes. |
open | No | boolean | undefined | Whether the popup is currently open. Use when controlled. |
openOnInputClick | No | boolean | undefined | Whether the popup opens when clicking the input. |
readOnly | No | boolean | undefined | Whether the user should be unable to choose a different option from the popup. |
required | No | boolean | undefined | Whether the user must choose a value before submitting a form. |
submitOnItemClick | No | boolean | undefined | 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. |
value | No | string | number | readonly string[] | undefined | The input value of the autocomplete. Use when controlled. |
virtualized | No | boolean | undefined | Whether the items are being externally virtualized. |
Autocomplete.List
| Property | Required | Type | Meaning |
|---|---|---|---|
children | No | ReactNode | ((item: any, index: number) => React.ReactNode) | See the usage contract and declaration. |
className | No | string | ((state: ComboboxListState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxListState> | undefined | 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. |
style | No | CSSProperties | ((state: ComboboxListState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
Autocomplete.Collection
| Property | Required | Type | Meaning |
|---|---|---|---|
children | Yes | (item: any, index: number) => React.ReactNode | See the usage contract and declaration. |
Autocomplete.Value
| Property | Required | Type | Meaning |
|---|---|---|---|
children | No | React.ReactNode | ((value: string) => React.ReactNode) | See the usage contract and declaration. |
Autocomplete.Portal
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ComboboxPortalState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
container | No | HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null | undefined | A parent element to render the portal element into. |
keepMounted | No | boolean | undefined | Whether to keep the portal mounted in the DOM while the popup is hidden. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxPortalState> | undefined | 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. |
style | No | CSSProperties | ((state: ComboboxPortalState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
Autocomplete.Input
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ComboboxInputState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
disabled | No | boolean | undefined | Whether the component should ignore user interaction. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxInputState> | undefined | 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. |
style | No | CSSProperties | ((state: ComboboxInputState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Autocomplete.InputGroup
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: AutocompleteInputGroupState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, AutocompleteInputGroupState> | undefined | 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. |
style | No | CSSProperties | ((state: AutocompleteInputGroupState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Autocomplete.Trigger
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: AutocompleteTriggerState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
disabled | No | boolean | undefined | Whether the component should ignore user interaction. |
nativeButton | No | boolean | undefined | 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>). |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, AutocompleteTriggerState> | undefined | 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. |
style | No | CSSProperties | ((state: AutocompleteTriggerState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Autocomplete.Icon
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ComboboxIconState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxIconState> | undefined | 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. |
style | No | CSSProperties | ((state: ComboboxIconState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Autocomplete.Clear
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ComboboxClearState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
disabled | No | boolean | undefined | Whether the component should ignore user interaction. |
keepMounted | No | boolean | undefined | Whether the component should remain mounted in the DOM when not visible. |
nativeButton | No | boolean | undefined | 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>). |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxClearState> | undefined | 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. |
style | No | CSSProperties | ((state: ComboboxClearState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Autocomplete.Backdrop
Example disposition: Optional popup presentation. The picker example intentionally uses an unadorned nonmodal popup; these parts are documented without changing established picker geometry.
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ComboboxBackdropState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxBackdropState> | undefined | 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. |
style | No | CSSProperties | ((state: ComboboxBackdropState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Autocomplete.Positioner
| Property | Required | Type | Meaning |
|---|---|---|---|
align | No | Align | undefined | How to align the popup relative to the specified side. |
alignOffset | No | number | OffsetFunction | undefined | 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. |
anchor | No | Element | VirtualElement | RefObject<Element | null> | (() => Element | VirtualElement | null) | null | undefined | An element to position the popup against. By default, the popup will be positioned against the trigger. |
arrowPadding | No | number | undefined | 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. |
className | No | string | ((state: ComboboxPositionerState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
collisionAvoidance | No | CollisionAvoidance | undefined | 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'. |
collisionBoundary | No | Boundary | undefined | An element or a rectangle that delimits the area that the popup is confined to. |
collisionPadding | No | Padding | undefined | Additional space to maintain from the edge of the collision boundary. |
disableAnchorTracking | No | boolean | undefined | Whether to disable the popup from tracking any layout shift of its positioning anchor. |
positionMethod | No | "absolute" | "fixed" | undefined | Determines which CSS position property to use. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxPositionerState> | undefined | 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. |
side | No | Side | undefined | Which side of the anchor element to align the popup against. May automatically change to avoid collisions. |
sideOffset | No | number | OffsetFunction | undefined | Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance 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. |
sticky | No | boolean | undefined | Whether to maintain the popup in the viewport after the anchor element was scrolled out of view. |
style | No | CSSProperties | ((state: ComboboxPositionerState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Autocomplete.Popup
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ComboboxPopupState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
finalFocus | No | boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => void | boolean | HTMLElement | null) | undefined | 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. |
initialFocus | No | boolean | RefObject<HTMLElement | null> | ((openType: InteractionType) => void | boolean | HTMLElement | null) | undefined | 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. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxPopupState> | undefined | 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. |
style | No | CSSProperties | ((state: ComboboxPopupState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Autocomplete.Arrow
Example disposition: Optional popup presentation. The picker example intentionally uses an unadorned nonmodal popup; these parts are documented without changing established picker geometry.
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ComboboxArrowState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxArrowState> | undefined | 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. |
style | No | CSSProperties | ((state: ComboboxArrowState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Autocomplete.Status
Example disposition: Optional persistent live region for application-owned async suggestions. The same underlying status primitive is now exercised in the async Combobox example; free-form autocomplete currently demonstrates synchronous filtering.
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ComboboxStatusState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxStatusState> | undefined | 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. |
style | No | CSSProperties | ((state: ComboboxStatusState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Autocomplete.Empty
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ComboboxEmptyState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxEmptyState> | undefined | 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. |
style | No | CSSProperties | ((state: ComboboxEmptyState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Autocomplete.Row
Example disposition: Optional grid-list composition requiring root grid mode and explicit rows. Flat and grouped selection are demonstrated; two-dimensional arrow navigation remains a distinct coverage limit, not a completed visual scenario.
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ComboboxRowState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxRowState> | undefined | 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. |
style | No | CSSProperties | ((state: ComboboxRowState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Autocomplete.Item
| Property | Required | Type | Meaning |
|---|---|---|---|
children | No | ReactNode | See the usage contract and declaration. |
className | No | string | ((state: AutocompleteItemState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
disabled | No | boolean | undefined | Whether the component should ignore user interaction. |
index | No | number | undefined | The index of the item in the list. Improves performance when specified by avoiding the need to calculate the index automatically from the DOM. |
nativeButton | No | boolean | undefined | 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. |
onClick | No | ((event: BaseUIEvent<MouseEvent<HTMLDivElement, MouseEvent>>) => void) | undefined | 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. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, AutocompleteItemState> | undefined | 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. |
style | No | CSSProperties | ((state: AutocompleteItemState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
value | No | any | A unique value that identifies this item. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Autocomplete.Group
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ComboboxGroupState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
items | No | readonly any[] | undefined | Items to be rendered within this group. When provided, child Collection components will use these items. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxGroupState> | undefined | 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. |
style | No | CSSProperties | ((state: ComboboxGroupState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Autocomplete.GroupLabel
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ComboboxGroupLabelState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ComboboxGroupLabelState> | undefined | 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. |
style | No | CSSProperties | ((state: ComboboxGroupLabelState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Autocomplete.Separator
Example disposition: Optional visual separation within application-authored groups; flat suggestions intentionally have no separator.
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: AutocompleteSeparatorState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
orientation | No | Orientation | undefined | The orientation of the separator. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, AutocompleteSeparatorState> | undefined | 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. |
style | No | CSSProperties | ((state: AutocompleteSeparatorState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly variant?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "variant"> | undefined; readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"autocomplete", "size"> | undefined; } | undefined | See the usage contract and declaration. |
Defaults and customization
Descriptor defaults: {"variant":"outline"}. Parts: input, input-group, trigger, icon, clear, backdrop, positioner, popup, arrow, status, empty, row, item, group, group-label, separator. Explicit instance props take precedence over configured defaults.
Use semantic tokens, public part hooks and customization sheets. Keep visual configuration separate from application state.
State, events and accessibility
For interactive controls, pair a controlled value/open prop with its corresponding change callback; default props initialize uncontrolled state. Keep application validation and submission policy explicit. Name controls with visible labels, name icon-only actions on the button, and preserve focus and dismissal behavior when replacing parts. Use native form names and submit/reset types where supported. See the usage guide for component-specific behavior and live examples.
Declaration authority
Generated from packages/faye-ui/dist/controls/autocomplete.d.ts after the semantic package build. Common native/React attributes are intentionally omitted from property tables. Generic overloads, discriminated unions and complete inherited attributes remain authoritative in installed TypeScript declarations. React DOM attributes and Base UI component contracts describe the inherited foundations.