@yamada-ui/autocomplete
Version:
Yamada UI autocomplete component
68 lines (65 loc) • 2.13 kB
TypeScript
import * as react from 'react';
import { HTMLUIProps, PropGetter } from '@yamada-ui/core';
interface UseAutocompleteOptionProps extends Omit<HTMLUIProps, "children" | "value"> {
/**
* The label of the autocomplete option.
*/
children?: string;
/**
* If `true`, the list element will be closed when selected.
*
* @default false
*/
closeOnSelect?: boolean;
/**
* If `true`, the autocomplete option will be disabled.
*
* @default false
*/
disabled?: boolean;
/**
* If `true`, the autocomplete option will be focusable.
*
* @default false
*/
focusable?: boolean;
/**
* If `true`, the autocomplete option will be disabled.
*
* @default false
*
* @deprecated Use `disabled` instead.
*/
isDisabled?: boolean;
/**
* If `true`, the autocomplete option will be focusable.
*
* @default false
*
* @deprecated Use `focusable` instead.
*/
isFocusable?: boolean;
/**
* The value of the autocomplete option.
*/
value?: string;
}
declare const useAutocompleteOption: (props: UseAutocompleteOptionProps) => {
target: boolean;
children: string | undefined;
customIcon: react.ReactElement<any, string | react.JSXElementConstructor<any>> | null | undefined;
focused: boolean;
omitSelectedValues: boolean | undefined;
selected: boolean;
getOptionProps: PropGetter<"div", undefined>;
};
type UseAutocompleteOptionReturn = ReturnType<typeof useAutocompleteOption>;
declare const useAutocompleteCreate: () => {
getCreateProps: PropGetter<"div", undefined>;
};
type UseAutocompleteCreateReturn = ReturnType<typeof useAutocompleteCreate>;
declare const useAutocompleteEmpty: () => {
getEmptyProps: PropGetter<"div", undefined>;
};
type UseAutocompleteEmptyReturn = ReturnType<typeof useAutocompleteEmpty>;
export { type UseAutocompleteCreateReturn, type UseAutocompleteEmptyReturn, type UseAutocompleteOptionProps, type UseAutocompleteOptionReturn, useAutocompleteCreate, useAutocompleteEmpty, useAutocompleteOption };