Skip to content

prosekit/react/autocomplete

AutocompleteEmptyProps

Props for the AutocompleteEmpty component.

AutocompleteItemProps

Props for the AutocompleteItem component.

onSelect

Type: undefined | ((event: CustomEvent<void>) => void)

value

The value of the item, which will be matched against the query.

If not provided, the value is the item's text content.

Type: string

Default: ""

AutocompleteListProps

Props for the AutocompleteList component.

onValueChange

Type: undefined | ((event: string) => void)

AutocompletePopoverProps

Props for the AutocompletePopover component.

boundary

Type: Boundary

Default: "The body element"

fitViewport

Type: boolean

Default: true

hoist

Type: boolean

Default: true

inline

Type: boolean

Default: true

offset

The distance between the popover and the hovered block.

Type: OffsetOptions

Default: 4

onOpenChange

Type: undefined | ((event: boolean) => void)

onQueryChange

Type: undefined | ((event: string) => void)

overflowPadding

Type: number

Default: 8

placement

The placement of the popover, relative to the text cursor.

Type: Placement

Default: "bottom-start"

regex

The regular expression to match the query text to autocomplete.

Type: null | RegExp

Default: null

AutocompleteEmpty

ts
function AutocompleteEmpty(props: AutocompleteEmptyProps & RefAttributes<AutocompleteEmpty> & HTMLAttributes<AutocompleteEmpty>): ReactNode

AutocompleteItem

ts
function AutocompleteItem(props: AutocompleteItemProps & RefAttributes<AutocompleteItem> & HTMLAttributes<AutocompleteItem>): ReactNode

AutocompleteList

ts
function AutocompleteList(props: AutocompleteListProps & RefAttributes<AutocompleteList> & HTMLAttributes<AutocompleteList>): ReactNode

AutocompletePopover

ts
function AutocompletePopover(props: AutocompletePopoverProps & RefAttributes<AutocompletePopover> & HTMLAttributes<AutocompletePopover>): ReactNode