@antadesign/anta
    Preparing search index...

    Interface InputAutocompleteProps

    interface InputAutocompleteProps {
        suggestions: (string | SelectOption<string>)[];
        value?: string;
        defaultValue?: string;
        onValueChange?: (value: string) => void;
        onSelect?: (option: SelectOption) => void;
        filter?: boolean | ((option: SelectOption, query: string) => boolean);
        placeholder?: string;
        size?: "small" | "medium" | "large";
        status?: "neutral" | "brand" | "info" | "success" | "warning" | "critical";
        statusIcon?: string & {} | false | (keyof IconShapes);
        tone?: string;
        clearable?: boolean;
        name?: string;
        disabled?: boolean;
        label?: ReactNode;
        hint?: ReactNode;
        leading?: ReactNode;
        trailing?: ReactNode;
        onFocus?: (event: any) => void;
        onBlur?: (event: any) => void;
        onInput?: (event: any) => void;
        onKeyDown?: (event: any) => void;
        className?: string;
        style?: CSSProperties;
        id?: string;
        title?: string;
        slot?: string;
        tabIndex?: number;
        key?: string | number | null;
        onClick?: (e: any) => void;
        onDoubleClick?: (e: any) => void;
        onAuxClick?: (e: any) => void;
        onContextMenu?: (e: any) => void;
        onMouseDown?: (e: any) => void;
        onMouseUp?: (e: any) => void;
        onMouseEnter?: (e: any) => void;
        onMouseLeave?: (e: any) => void;
        onMouseMove?: (e: any) => void;
        onMouseOver?: (e: any) => void;
        onMouseOut?: (e: any) => void;
        onPointerDown?: (e: any) => void;
        onPointerUp?: (e: any) => void;
        onPointerMove?: (e: any) => void;
        onPointerEnter?: (e: any) => void;
        onPointerLeave?: (e: any) => void;
        onPointerOver?: (e: any) => void;
        onPointerOut?: (e: any) => void;
        onPointerCancel?: (e: any) => void;
        onGotPointerCapture?: (e: any) => void;
        onLostPointerCapture?: (e: any) => void;
        onTouchStart?: (e: any) => void;
        onTouchEnd?: (e: any) => void;
        onTouchMove?: (e: any) => void;
        onTouchCancel?: (e: any) => void;
        onKeyUp?: (e: any) => void;
        onChange?: (e: any) => void;
        onBeforeInput?: (e: any) => void;
        onInvalid?: (e: any) => void;
        onReset?: (e: any) => void;
        onSubmit?: (e: any) => void;
        onCopy?: (e: any) => void;
        onCut?: (e: any) => void;
        onPaste?: (e: any) => void;
        onCompositionStart?: (e: any) => void;
        onCompositionUpdate?: (e: any) => void;
        onCompositionEnd?: (e: any) => void;
        onDrag?: (e: any) => void;
        onDragStart?: (e: any) => void;
        onDragEnd?: (e: any) => void;
        onDragEnter?: (e: any) => void;
        onDragLeave?: (e: any) => void;
        onDragOver?: (e: any) => void;
        onDrop?: (e: any) => void;
        onScroll?: (e: any) => void;
        onWheel?: (e: any) => void;
        onAnimationStart?: (e: any) => void;
        onAnimationEnd?: (e: any) => void;
        onAnimationIteration?: (e: any) => void;
        onTransitionEnd?: (e: any) => void;
        onLoad?: (e: any) => void;
        onError?: (e: any) => void;
        onAbort?: (e: any) => void;
        onToggle?: (e: any) => void;
        onBeforeToggle?: (e: any) => void;
        onCanPlay?: (e: any) => void;
        onCanPlayThrough?: (e: any) => void;
        onDurationChange?: (e: any) => void;
        onEmptied?: (e: any) => void;
        onEnded?: (e: any) => void;
        onLoadedData?: (e: any) => void;
        onLoadedMetadata?: (e: any) => void;
        onLoadStart?: (e: any) => void;
        onPause?: (e: any) => void;
        onPlay?: (e: any) => void;
        onPlaying?: (e: any) => void;
        onProgress?: (e: any) => void;
        onRateChange?: (e: any) => void;
        onSeeked?: (e: any) => void;
        onSeeking?: (e: any) => void;
        onStalled?: (e: any) => void;
        onSuspend?: (e: any) => void;
        onTimeUpdate?: (e: any) => void;
        onVolumeChange?: (e: any) => void;
        onWaiting?: (e: any) => void;
        [key: `data-${string}`]: unknown;
        [key: `aria-${string}`]: unknown;
    }

    Hierarchy

    Indexable

    • [key: `data-${string}`]: unknown
    • [key: `aria-${string}`]: unknown
    Index
    suggestions: (string | SelectOption<string>)[]

    The suggestions: bare strings or SelectOptions (value / label / hint / icon / tone / disabled). A flat list; picking one fills the field.

    value?: string

    The controlled field text. Any string is valid, including '' for an empty field. Omit or pass undefined for uncontrolled use. Parent updates do not call onValueChange. Releasing control retains the latest controlled text.

    defaultValue?: string

    Initial uncontrolled text and the value restored by a form reset. Resetting an unfocused field does not open suggestions or move focus.

    onValueChange?: (value: string) => void

    Reports text changes from typing, picking a suggestion, clearing, or form reset.

    onSelect?: (option: SelectOption) => void

    Fires after onValueChange when a suggestion is chosen, with the normalized option. This reports the choice even if a controlled parent rejects the value. Typing and clearing do not call it.

    filter?: boolean | ((option: SelectOption, query: string) => boolean)

    How suggestions match the text. true uses the built-in case-insensitive substring match on value / label / hint; a function (option, query) => boolean receives the original field text, including whitespace, once per option on each render, including when empty. Custom matching has no automatic highlighting. false shows suggestions unchanged for application-provided async or remote filtering, without automatic highlighting. Replacing results updates an open list but does not reopen a dismissed list.

    true
    
    placeholder?: string

    Placeholder text.

    size?: "small" | "medium" | "large"

    Field size.

    medium
    
    status?: "neutral" | "brand" | "info" | "success" | "warning" | "critical"

    Validation status.

    statusIcon?: string & {} | false | (keyof IconShapes)

    Status icon override, or false to drop it.

    tone?: string

    Custom accent color — a named tone or any CSS color.

    clearable?: boolean

    Show a clear button while the field has text.

    name?: string

    Form field name.

    disabled?: boolean

    Disable the field.

    label?: ReactNode

    Field label.

    hint?: ReactNode

    Hint under the field.

    leading?: ReactNode

    Leading adornment inside the field.

    trailing?: ReactNode

    Trailing adornment inside the field.

    onFocus?: (event: any) => void

    Observe focus before the suggestion list opens.

    onBlur?: (event: any) => void

    Observe focus loss. The suggestion list closes without changing the text.

    onInput?: (event: any) => void

    Observe editing before onValueChange. The input event reports text that has already changed; preventDefault() does not reject that text.

    onKeyDown?: (event: any) => void

    Observe keys before the wrapper's plain-Enter dismissal. preventDefault() keeps that dismissal from running. Menu handles navigation and active-option activation earlier, in document capture; this callback cannot veto those actions. Composing keys remain with the input method.

    className?: string

    Adds CSS classes to the root element and preserves its existing classes.

    style?: CSSProperties

    Inline CSS styles on the root element.

    id?: string

    HTML id attribute.

    title?: string

    HTML title attribute, shown as a browser tooltip on hover.

    slot?: string

    Named slot in a parent web component, such as slot="header" in a <Dialog>.

    tabIndex?: number

    Tab order. Set to -1 to skip the element when tabbing.

    key?: string | number | null

    React/Preact reconciliation key when rendered inside a list. Consumed by the JSX runtime (not forwarded as a DOM attribute).

    onClick?: (e: any) => void
    onDoubleClick?: (e: any) => void
    onAuxClick?: (e: any) => void
    onContextMenu?: (e: any) => void
    onMouseDown?: (e: any) => void
    onMouseUp?: (e: any) => void
    onMouseEnter?: (e: any) => void
    onMouseLeave?: (e: any) => void
    onMouseMove?: (e: any) => void
    onMouseOver?: (e: any) => void
    onMouseOut?: (e: any) => void
    onPointerDown?: (e: any) => void
    onPointerUp?: (e: any) => void
    onPointerMove?: (e: any) => void
    onPointerEnter?: (e: any) => void
    onPointerLeave?: (e: any) => void
    onPointerOver?: (e: any) => void
    onPointerOut?: (e: any) => void
    onPointerCancel?: (e: any) => void
    onGotPointerCapture?: (e: any) => void
    onLostPointerCapture?: (e: any) => void
    onTouchStart?: (e: any) => void
    onTouchEnd?: (e: any) => void
    onTouchMove?: (e: any) => void
    onTouchCancel?: (e: any) => void
    onKeyUp?: (e: any) => void
    onChange?: (e: any) => void
    onBeforeInput?: (e: any) => void
    onInvalid?: (e: any) => void
    onReset?: (e: any) => void
    onSubmit?: (e: any) => void
    onCopy?: (e: any) => void
    onCut?: (e: any) => void
    onPaste?: (e: any) => void
    onCompositionStart?: (e: any) => void
    onCompositionUpdate?: (e: any) => void
    onCompositionEnd?: (e: any) => void
    onDrag?: (e: any) => void
    onDragStart?: (e: any) => void
    onDragEnd?: (e: any) => void
    onDragEnter?: (e: any) => void
    onDragLeave?: (e: any) => void
    onDragOver?: (e: any) => void
    onDrop?: (e: any) => void
    onScroll?: (e: any) => void
    onWheel?: (e: any) => void
    onAnimationStart?: (e: any) => void
    onAnimationEnd?: (e: any) => void
    onAnimationIteration?: (e: any) => void
    onTransitionEnd?: (e: any) => void
    onLoad?: (e: any) => void
    onError?: (e: any) => void
    onAbort?: (e: any) => void
    onToggle?: (e: any) => void
    onBeforeToggle?: (e: any) => void
    onCanPlay?: (e: any) => void
    onCanPlayThrough?: (e: any) => void
    onDurationChange?: (e: any) => void
    onEmptied?: (e: any) => void
    onEnded?: (e: any) => void
    onLoadedData?: (e: any) => void
    onLoadedMetadata?: (e: any) => void
    onLoadStart?: (e: any) => void
    onPause?: (e: any) => void
    onPlay?: (e: any) => void
    onPlaying?: (e: any) => void
    onProgress?: (e: any) => void
    onRateChange?: (e: any) => void
    onSeeked?: (e: any) => void
    onSeeking?: (e: any) => void
    onStalled?: (e: any) => void
    onSuspend?: (e: any) => void
    onTimeUpdate?: (e: any) => void
    onVolumeChange?: (e: any) => void
    onWaiting?: (e: any) => void