tiptap/docs/api/utilities/suggestion.md
Philipp Kühn a6f731af39
feat!: Add editor to items prop in suggestion plugin (#2082)
* add editor to items prop

* docs: update content
2021-10-25 09:42:41 +02:00

1.3 KiB

Suggestion

Version Downloads

This utility helps with all kinds of suggestions in the editor. Have a look at the Mention, Hashtag or Emoji node to see it in action.

Settings

char

The character that triggers the autocomplete popup.

Default: '@'

pluginKey

A ProseMirror PluginKey.

Default: SuggestionPluginKey

allowSpaces

Allows or disallows spaces in suggested items.

Default: false

startOfLine

Trigger the autocomplete popup at the start of a line only.

Default: false

decorationTag

The HTML tag that should be rendered for the suggestion.

Default: 'span'

decorationClass

A CSS class that should be added to the suggestion.

Default: 'suggestion'

command

Executed when a suggestion is selected.

Default: () => {}'

items

Pass an array of filtered suggestions, can be async.

Default: ({ editor, query }) => []

render

A render function for the autocomplete popup.

Default: () => ({})

Source code

packages/suggestion/