Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:0xranx OpenContext Tiptap SlashMenu

From Leeroopedia
Knowledge Sources
Domains Editor, React
Last Updated 2026-10-24 00:00 GMT

Overview

Slash command menu for the Tiptap editor, triggered by typing "/" to insert blocks like headings, lists, tables, code blocks, and page references.

Description

The SlashMenu.jsx component in src/ui/src/editor/tiptap/ detects "/" typed at the start of a line or after whitespace in the Tiptap editor. It opens a filterable dropdown of block types with i18n labels, keyboard navigation (arrows, Enter, Escape), and scroll-into-view for the active item. Selecting an item removes the trigger text and inserts the corresponding block via Tiptap chain commands.

Usage

Import this component in TiptapMarkdown.jsx and render it with the editor instance.

Code Reference

Source Location

Signature

export default function SlashMenu({ editor, onOpenPageRefPicker })

Import

import SlashMenu from './editor/tiptap/SlashMenu';

I/O Contract

Inputs

Name Type Required Description
editor Editor Yes Tiptap editor instance
onOpenPageRefPicker Function No Opens page reference picker

Usage Examples

Rendering Slash Menu

import SlashMenu from './editor/tiptap/SlashMenu';

<SlashMenu
  editor={editor}
  onOpenPageRefPicker={() => setPageRefOpen(true)}
/>

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment