Skip to content

prosekit/web/autocomplete

AutocompleteEmptyElement

Renames and re-exports AutocompleteEmpty

AutocompleteItemElement

Renames and re-exports AutocompleteItem

AutocompleteListElement

Renames and re-exports AutocompleteList

AutocompletePopoverElement

Renames and re-exports AutocompletePopover

AutocompleteEmptyProps

Extends

  • EmptyObject

AutocompleteItemProps

Properties

onSelect

onSelect: null | VoidFunction

The function to call when the item is selected.

Default
ts
null

value

value: string

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

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

Default
ts
""

AutocompleteListProps

Extends

  • Pick<ListboxProps, "filter">

Properties

editor

editor: null | Editor<any>


AutocompletePopoverProps

Extends

  • OverlayPositionerProps

Properties

boundary

boundary: Boundary

Default
ts
"The body element"
Overrides

OverlayPositionerProps.boundary

editor

editor: null | Editor<any>

The ProseKit editor instance.

Default
ts
null

fitViewport

fitViewport: boolean

Default
ts
true
Overrides

OverlayPositionerProps.fitViewport

hoist

hoist: boolean

Default
ts
true
Overrides

OverlayPositionerProps.hoist

inline

inline: boolean

Default
ts
true
Overrides

OverlayPositionerProps.inline

offset

offset: null | OffsetOptions

The distance between the popover and the hovered block.

Default
ts
4
Overrides

OverlayPositionerProps.offset

onOpenChange

onOpenChange: null | (open) => void

A callback that is called when the open state changes.

onQueryChange

onQueryChange: null | (query) => void

A callback that is called when the query changes.

overflowPadding

overflowPadding: number

Default
ts
8
Overrides

OverlayPositionerProps.overflowPadding

placement

placement: Placement

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

Default
ts
"bottom-start"
Overrides

OverlayPositionerProps.placement

regex

regex: null | RegExp

The regular expression to match the query text to autocomplete.

Default
ts
null

defaultAutocompleteEmptyProps

const defaultAutocompleteEmptyProps: object


defaultAutocompleteItemProps

const defaultAutocompleteItemProps: object

Type declaration

NameTypeDefault value
onSelectnullnull
valuestring''

defaultAutocompleteListProps

const defaultAutocompleteListProps: object

Type declaration

NameTypeDefault value
editornullnull
filter(options) => booleandefaultFilter

defaultAutocompletePopoverProps

const defaultAutocompletePopoverProps: Readonly<object>

Type declaration

NameTypeDefault value
boundaryHTMLBodyElement | "clippingAncestors"defaultBoundary
editornullnull
fitViewporttruetrue
hoisttruetrue
inlinetruetrue
offset44
onOpenChangenullnull
onQueryChangenullnull
overflowPadding88
placement"bottom-start"'bottom-start'
regexnullnull