Circle V2 API Docs
    Preparing search index...

    Interface UseComboboxReturn<T>

    interface UseComboboxReturn<T extends CollectionItem> {
        clearHighlightValue: VoidFunction;
        clearValue: (value?: string) => void;
        collection: ListCollection<T>;
        disabled: boolean;
        focus: VoidFunction;
        focused: boolean;
        getClearTriggerProps: () => WithoutRef<
            DetailedHTMLProps<
                ButtonHTMLAttributes<HTMLButtonElement>,
                HTMLButtonElement,
            >,
        >;
        getContentProps: () => WithoutRef<HTMLAttributes<HTMLElement>>;
        getControlProps: () => WithoutRef<HTMLAttributes<HTMLElement>>;
        getInputProps: () => WithoutRef<
            DetailedHTMLProps<
                InputHTMLAttributes<HTMLInputElement>,
                HTMLInputElement,
            >,
        >;
        getItemGroupLabelProps: (
            props: ItemGroupLabelProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getItemGroupProps: (
            props: ItemGroupProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getItemIndicatorProps: (
            props: ItemProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getItemProps: (props: ItemProps) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getItemState: (props: ItemProps) => ItemState;
        getItemTextProps: (
            props: ItemProps,
        ) => WithoutRef<HTMLAttributes<HTMLElement>>;
        getLabelProps: () => WithoutRef<
            DetailedHTMLProps<
                LabelHTMLAttributes<HTMLLabelElement>,
                HTMLLabelElement,
            >,
        >;
        getListProps: () => WithoutRef<HTMLAttributes<HTMLElement>>;
        getPositionerProps: () => WithoutRef<HTMLAttributes<HTMLElement>>;
        getRootProps: () => WithoutRef<HTMLAttributes<HTMLElement>>;
        getTriggerProps: (
            props?: TriggerProps,
        ) => WithoutRef<
            DetailedHTMLProps<
                ButtonHTMLAttributes<HTMLButtonElement>,
                HTMLButtonElement,
            >,
        >;
        hasSelectedItems: boolean;
        highlightedItem: T | null;
        highlightedValue: string | null;
        inputValue: string;
        multiple: boolean;
        open: boolean;
        reposition: (options?: Partial<PositioningOptions>) => void;
        selectedItems: T[];
        selectValue: (value: string) => void;
        setHighlightValue: (value: string) => void;
        setInputValue: (value: string, reason?: InputValueChangeReason) => void;
        setOpen: (open: boolean, reason?: OpenChangeReason) => void;
        setValue: (value: string[]) => void;
        syncSelectedItems: VoidFunction;
        value: string[];
        valueAsString: string;
    }

    Type Parameters

    • T extends CollectionItem

    Hierarchy

    • ComboboxApi<PropTypes, T>
      • UseComboboxReturn
    Index

    Properties

    clearHighlightValue: VoidFunction

    Function to clear the highlighted value

    clearValue: (value?: string) => void

    Function to clear the value of the combobox

    collection: ListCollection<T>

    Function to toggle the combobox

    disabled: boolean

    Whether the combobox is disabled

    focus: VoidFunction

    Function to focus on the combobox input

    focused: boolean

    Whether the combobox is focused

    getClearTriggerProps: () => WithoutRef<
        DetailedHTMLProps<
            ButtonHTMLAttributes<HTMLButtonElement>,
            HTMLButtonElement,
        >,
    >
    getContentProps: () => WithoutRef<HTMLAttributes<HTMLElement>>
    getControlProps: () => WithoutRef<HTMLAttributes<HTMLElement>>
    getInputProps: () => WithoutRef<
        DetailedHTMLProps<
            InputHTMLAttributes<HTMLInputElement>,
            HTMLInputElement,
        >,
    >
    getItemGroupLabelProps: (
        props: ItemGroupLabelProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    getItemGroupProps: (
        props: ItemGroupProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    getItemIndicatorProps: (
        props: ItemProps,
    ) => WithoutRef<HTMLAttributes<HTMLElement>>
    getItemProps: (props: ItemProps) => WithoutRef<HTMLAttributes<HTMLElement>>
    getItemState: (props: ItemProps) => ItemState

    Returns the state of a combobox item

    getItemTextProps: (props: ItemProps) => WithoutRef<HTMLAttributes<HTMLElement>>
    getLabelProps: () => WithoutRef<
        DetailedHTMLProps<
            LabelHTMLAttributes<HTMLLabelElement>,
            HTMLLabelElement,
        >,
    >
    getListProps: () => WithoutRef<HTMLAttributes<HTMLElement>>
    getPositionerProps: () => WithoutRef<HTMLAttributes<HTMLElement>>
    getRootProps: () => WithoutRef<HTMLAttributes<HTMLElement>>
    getTriggerProps: (
        props?: TriggerProps,
    ) => WithoutRef<
        DetailedHTMLProps<
            ButtonHTMLAttributes<HTMLButtonElement>,
            HTMLButtonElement,
        >,
    >
    hasSelectedItems: boolean

    Whether there's a selected item

    highlightedItem: T | null

    The highlighted item

    highlightedValue: string | null

    The value of the highlighted item

    inputValue: string

    The value of the combobox input

    multiple: boolean

    Whether the combobox allows multiple selections

    open: boolean

    Whether the combobox is open

    reposition: (options?: Partial<PositioningOptions>) => void

    Function to set the positioning options

    selectedItems: T[]

    The selected items

    selectValue: (value: string) => void

    Function to select a value

    setHighlightValue: (value: string) => void

    The value of the combobox input

    setInputValue: (value: string, reason?: InputValueChangeReason) => void

    Function to set the input value of the combobox

    setOpen: (open: boolean, reason?: OpenChangeReason) => void

    Function to open or close the combobox

    setValue: (value: string[]) => void

    Function to set the value of the combobox

    syncSelectedItems: VoidFunction

    Function to sync the selected items with the value. Useful when value is updated from async sources.

    value: string[]

    The selected item keys

    valueAsString: string

    The string representation of the selected items