Vue
ProseKit has first-class support for Vue via prosekit/vue.
Provider
Section titled “Provider”<ProseKit :editor="editor"> provides context to its descendants. The component itself does not render any DOM, it only forwards children.
Composables
Section titled “Composables”All composables live in prosekit/vue.
useEditor
Section titled “useEditor”Returns the editor instance from the nearest <ProseKit> provider as a ShallowRef. Pass { update: true } to trigger reactive updates when the editor state changes.
useEditorDerivedValue
Section titled “useEditorDerivedValue”Returns a ShallowRef that updates whenever the editor state changes. Use this for derived UI state. It skips re-running derive between edits, which is what you want for toolbar enabled/active flags.
useExtension
Section titled “useExtension”Register an extension for the lifetime of the calling component.
useKeymap
Section titled “useKeymap”Bind a keymap. Pass a ref or getter to swap the bindings reactively.
useDocChange
Section titled “useDocChange”Run handler whenever the editor's document changes. The handler receives the current document node.
useStateUpdate
Section titled “useStateUpdate”Same as useDocChange but fires on every state update, including selection changes.
Custom node and mark views
Section titled “Custom node and mark views”defineVueNodeView
Section titled “defineVueNodeView”Render a node with a Vue component. The component receives node, view, getPos, setAttrs, decorations, and selected as props (VueNodeViewProps).
defineVueMarkView
Section titled “defineVueMarkView”Same shape as defineVueNodeView but for marks.
See also
Section titled “See also”- The Editor concept page
- Extensions & union
- Components: pre-built Vue components for toolbar, inline menu, slash menu, and friends.
prosekit/vuereference- Minimal example
- Full-featured example