Plugins
Package extensions, toolbar buttons, slash commands and translations with definePlugin().
definePlugin() is the recommended way to share functionality — in your app or as an npm package. The result is a normal Tiptap extension you add to extensions.
plugins/timestamp.ts
Definition
| Field | Type | Description |
|---|---|---|
name | string | Required. Unique name (also the extension name). |
defaultOptions | object | Options available as options in the callbacks; override with plugin.configure({ pluginOptions }). |
extensions | AnyExtension[] | (options) => AnyExtension[] | Tiptap extensions the plugin brings along. |
toolbar | ButtonView | Toolbar button(s). |
slashCommands | PluginSlashGroup[] | (ctx) => PluginSlashGroup[] | Slash menu contributions. |
locales | Record<lang, Record<key, string>> | Translations, registered when the plugin is defined. |
setup | ({ editor, options }) => void | (() => void) | Called after the editor is created; the returned function runs on destroy. |
Options
Slash commands
A PluginSlashGroup with the name of a preset group (format, insert, others) appends commands to it; any other name creates a new group titled title (a string or a locale key).
Publishing a plugin
- Name the package
echo-editor-plugin-*and add theecho-editor-pluginkeyword. - List
vue-echo-editorand any@tiptap/*packages as peer dependencies. - Ship translations for at least English through
locales.