Skip to content

Type Editor


Type Editor / @type-editor/menu / MenuBarBuilder

MenuBarBuilder

Classes

ClassDescription

MenuBarBuilder

Builder for constructing a ProseMirror menu bar plugin.

Use addMenuGroup to add flat groups of items to the toolbar, and addDropDown to add dropdown menus. Finish with build() to produce the configured Plugin instance.

Example

ts
const plugin = new MenuBarBuilder()
  .addMenuGroup(boldItem, italicItem)
  .addDropDown({ label: "Insert" }, tableItem, imageItem)
  .build();

Type Aliases

Type AliasDescription

MenuElementInput

Accepted input types for a single menu element entry in a group or dropdown. Arrays of MenuElement are flattened, while falsy values (null, undefined) are ignored.