@prosekit/svelte package, offering Svelte-specific components, runes, and utilities for building powerful editors.
Installation
svelte>= 5.0.0
Quick Start
Create a basic editor with Svelte:Core Components
ProseKit
The root component that provides editor context to all child components.editor: The editor instance created withcreateEditor()
Essential Functions
useEditor
Retrieves the editor instance from the nearestProseKit component.
Readable<Editor> (Svelte store)
Options:
update?: boolean- Whether to update the store when editor state changes (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 Svelte 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 Svelte:UI Components
ProseKit provides pre-built Svelte 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:Svelte 5 Runes
ProseKit works seamlessly with Svelte 5’s new runes:Server-Side Rendering (SSR)
ProseKit supports server-side rendering with SvelteKit: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