Skip to content

Command Registry

The command registry connects built-in toolbar buttons to Core commands. It mainly supports custom toolbars, button capability audits, and equivalent behavior across the three adapters.

ts
import {
  getCommandLabel,
  isToolbarCommandActive,
  runToolbarCommand,
  type ToolbarBuiltinKey,
} from 'tiptap-vue-pro-core'

const id: ToolbarBuiltinKey = 'bold'

console.log(getCommandLabel(id))
runToolbarCommand(ctx, id)
console.log(isToolbarCommandActive(ctx, id))

Common Uses

Use caseAPI
Read button labelgetCommandLabel(id)
Run a built-in commandrunToolbarCommand(ctx, id, payload)
Check active stateisToolbarCommandActive(ctx, id, payload)
Get the active heading levelgetActiveHeadingLevel(ctx)
Get the current text alignmentgetActiveTextAlign(ctx)

Some buttons are compound UI, such as link dialogs, image upload, table grid, Markdown import/export, print, preview, and fullscreen. These buttons do not have a simple execute; adapters render the corresponding interaction.

Relationship With Custom Toolbars

If you only want to reuse built-in commands, call ctx.commands directly. If you want to render a toolbar dynamically from button ids, use the command registry to read labels, active state, and execute functions.

A community package built on Tiptap v3 + Vue 3.