Skip to content
GitHubDiscord

prosekit/preact

children?: ComponentChildren

editor: Editor


editor?: Editor<any>

The editor to add the extension to. If not provided, it will use the editor from the nearest ProseKit component.

priority?: Priority

Optional priority to add the extension with.

const ProseKit: ComponentType<ProseKitProps>

The root component for a ProseKit editor.

function useDocChange(handler: (doc: ProseMirrorNode) => void, options?: UseExtensionOptions): void

Calls the given handler whenever the editor document changes.


function useEditor<E>(options?: object): Editor<E>

Retrieves the editor instance from the nearest ProseKit component.


function useExtension(extension: null | Extension<ExtensionTyping<any, any, any>>, options?: UseExtensionOptions): void

Add an extension to the editor.


function useKeymap(keymap: Keymap, options?: UseExtensionOptions): void


function useStateUpdate(handler: (state: EditorState) => void, options?: UseExtensionOptions): void

Calls the given handler whenever the editor state changes.