A dropdown menu for mentioning users
Upgrade to v3
To use UI components or templates you need to upgrade to Editor version 3.x. See the upgrade guide for more details.
Install
npx @tiptap/cli add mention-dropdown-menuUsage
import { MentionDropdownMenu } from '@/components/tiptap-ui/mention-dropdown-menu'
import { useEditor, EditorContent } from '@tiptap/react'
import { Mention } from '@tiptap/extension-mention'
export default function MyEditor() {
const editor = useEditor({
extensions: [
// other extensions
Mention.configure({
// mention configuration
}),
],
})
return (
<div>
<EditorContent editor={editor} />
<MentionDropdownMenu editor={editor} />
</div>
)
}Props
| Name | Type | Default | Description |
|---|---|---|---|
| editor | Editor | null | null | The Tiptap editor instance |
| floatingOptions | object | - | Options for floating UI |
| selector | string | 'tiptap-mention-dropdown-menu' | Selector for the target |
| char | string | '@' | Mention character |
Requirements
Used reference components
tiptap-utils(lib)suggestion-menu(ui)avatar(primitive)button(primitive)