@prosekit/react package, offering React-specific components, hooks, and utilities for building powerful editors.
Installation
react>= 18.2.0react-dom>= 18.2.0
Quick Start
Create a basic editor with React:Core Components
ProseKit
The root component that provides editor context to all child components.editor: The editor instance created withcreateEditor()children?: React child nodes
Essential Hooks
useEditor
Retrieves the editor instance from the nearestProseKit component.
update?: boolean- Whether to re-render when editor state updates (default:false)
useEditorDerivedValue
Compute and subscribe to derived values from the editor state.useExtension
Dynamically add extensions to the editor.editor?: Editor- Optional editor instance (defaults to context editor)priority?: Priority- Extension priority
useKeymap
Define keyboard shortcuts.useDocChange
Execute a callback when the document changes.useStateUpdate
Execute a callback on every state update (including selection changes).Custom Node Views
Create interactive node views with React components:node- The ProseMirror nodeview- The editor viewgetPos- Function to get node positionsetAttrs- Function to update node attributesdecorations- Node decorationsselected- Whether the node is selected
Custom Mark Views
Create custom mark rendering with React:UI Components
ProseKit provides pre-built React components for common editor UI patterns:Autocomplete
Inline Popover
Tooltip
Popover
Block Handle
Table Handle
Resizable
TypeScript Support
ProseKit has full TypeScript support with type inference:Server-Side Rendering (SSR)
ProseKit supports server-side rendering with Next.js and other React frameworks:Examples
Check out full working examples:Next Steps
Extensions
Learn about available extensions
Commands
Explore editor commands
Styling
Customize editor appearance
API Reference
Full API documentation