1.5 KiB
1.5 KiB
Floating Menu
This extension will make a contextual menu appear near a selection of text.
Installation
# with npm
npm install @tiptap/extension-floating-menu
# with Yarn
yarn add @tiptap/extension-floating-menu
Settings
| Option | Type | Default | Description |
|---|---|---|---|
| element | HTMLElement |
null |
The DOM element of your menu. |
| tippyOptions | Object |
{} |
Options for tippy.js |
Source code
packages/extension-floating-menu/
Using Vanilla JavaScript
import { Editor } from '@tiptap/core'
import FloatingMenu from '@tiptap/extension-floating-menu'
new Editor({
extensions: [
FloatingMenu.configure({
element: document.querySelector('.menu'),
}),
],
})