Svelte
ProseKit has first-class support for Svelte via prosekit/svelte.
Provider
Section titled “Provider”<ProseKit {editor}> provides context to its descendants. The component itself does not render any DOM, it only forwards children. Always wrap any UI that calls useEditor() in this provider.
useEditor
Section titled “useEditor”Returns a Svelte Readable store. Pass { update: true } if you want the store to fire on every editor state change.
useEditorDerivedValue
Section titled “useEditorDerivedValue”Returns a Readable that re-runs derive whenever the editor state changes.
useExtension, useKeymap, useDocChange, useStateUpdate
Section titled “useExtension, useKeymap, useDocChange, useStateUpdate”Same options shape as React. All four return void and bind to the calling component's lifecycle.
Custom node and mark views
Section titled “Custom node and mark views”The Svelte component receives node, view, getPos, setAttrs, decorations, and selected as props (SvelteNodeViewProps). defineSvelteMarkView is the mark equivalent.