mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-03 02:39:02 +08:00
1.9 KiB
1.9 KiB
Suggestion
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
Option | Type | Default | Description |
---|---|---|---|
char | String |
'@' |
The character that triggers the autocomplete popup. |
pluginKey | PluginKey |
SuggestionPluginKey |
A ProseMirror PluginKey. |
allowSpaces | Boolean |
false |
Allows or disallows spaces in suggested items. |
startOfLine | Boolean |
false |
Trigger the autocomplete popup at the start of a line only. |
decorationTag | String |
'span' |
The HTML tag that should be rendered for the suggestion. |
decorationClass | String |
'suggestion' |
A CSS class that should be added to the suggestion. |
command | Function |
() => {}' |
Executed when a suggestion is selected. |
items | Function |
() => {} |
Pass an array of filtered suggestions, can be async. |
render | Function |
() => ({}) |
A render function for the autocomplete popup. |