Skip to content
This page is for Tiptap 2.x.See the latest version of this page.

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-menu

Usage

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

NameTypeDefaultDescription
editorEditor | nullnullThe Tiptap editor instance
floatingOptionsobject-Options for floating UI
selectorstring'tiptap-mention-dropdown-menu'Selector for the target
charstring'@'Mention character

Requirements

Used reference components

  • tiptap-utils (lib)
  • suggestion-menu (ui)
  • avatar (primitive)
  • button (primitive)