Requirements
Before installing ProseKit, ensure your project meets these requirements:- Node.js: Version 16.0 or higher
- Package Manager: npm, yarn, pnpm, or bun
- Framework (optional): React 18.2+, Vue 3.0+, Svelte 5.0+, Preact 10.11+, or Solid 1.7+
Installation Methods
Quick Install with shadcn/ui
If you’re using shadcn/ui, you can install a complete editor component with a single command:- Toolbar with formatting controls
- Inline formatting menu
- Slash commands
- Block handles for drag-and-drop
- Table controls
- And all the styling pre-configured
Manual Installation
For more control over your setup, install ProseKit manually:Framework Setup
React
ProseKit works with React 18.2 and higher.import 'prosekit/basic/style.css'
import 'prosekit/basic/typography.css'
import { defineBasicExtension } from 'prosekit/basic'
import { createEditor } from 'prosekit/core'
import { ProseKit } from 'prosekit/react'
import { useMemo } from 'react'
export default function Editor() {
const editor = useMemo(() => {
const extension = defineBasicExtension()
return createEditor({ extension })
}, [])
return (
<ProseKit editor={editor}>
<div ref={editor.mount} className="editor" />
</ProseKit>
)
}
ProseKit works with both React Client Components and Server Components. The editor itself must be a Client Component (use
'use client' directive in Next.js).Vue
ProseKit works with Vue 3.0 and higher.<script setup lang="ts">
import 'prosekit/basic/style.css'
import 'prosekit/basic/typography.css'
import { defineBasicExtension } from 'prosekit/basic'
import { createEditor } from 'prosekit/core'
import { ProseKit } from 'prosekit/vue'
const extension = defineBasicExtension()
const editor = createEditor({ extension })
</script>
<template>
<ProseKit :editor="editor">
<div :ref="(el) => editor.mount(el as HTMLElement | null)" class="editor" />
</ProseKit>
</template>
Svelte
ProseKit works with Svelte 5.0 and higher.<script lang="ts">
import 'prosekit/basic/style.css'
import 'prosekit/basic/typography.css'
import { defineBasicExtension } from 'prosekit/basic'
import { createEditor } from 'prosekit/core'
import { ProseKit } from 'prosekit/svelte'
const extension = defineBasicExtension()
const editor = createEditor({ extension })
</script>
<ProseKit {editor}>
<div bind:this={editor.mount} class="editor" />
</ProseKit>
Preact
ProseKit works with Preact 10.11 and higher.import 'prosekit/basic/style.css'
import 'prosekit/basic/typography.css'
import { defineBasicExtension } from 'prosekit/basic'
import { createEditor } from 'prosekit/core'
import { ProseKit } from 'prosekit/preact'
import { useMemo } from 'preact/hooks'
export default function Editor() {
const editor = useMemo(() => {
const extension = defineBasicExtension()
return createEditor({ extension })
}, [])
return (
<ProseKit editor={editor}>
<div ref={editor.mount} className="editor" />
</ProseKit>
)
}
Solid
ProseKit works with Solid 1.7 and higher.import 'prosekit/basic/style.css'
import 'prosekit/basic/typography.css'
import { defineBasicExtension } from 'prosekit/basic'
import { createEditor } from 'prosekit/core'
import { ProseKit } from 'prosekit/solid'
export default function Editor() {
const extension = defineBasicExtension()
const editor = createEditor({ extension })
return (
<ProseKit editor={editor}>
<div ref={editor.mount} class="editor" />
</ProseKit>
)
}
Vanilla JavaScript
ProseKit can be used without any framework:Required Styles
Always import the basic styles for ProseKit to function correctly.
Additional Extension Styles
Some extensions require their own stylesheets:Optional Peer Dependencies
For Collaborative Editing
If you’re using collaborative editing features:For Math Equations
If you’re using the math extension:TypeScript Configuration
ProseKit is built with TypeScript and provides full type definitions. No additional configuration is needed, but ensure yourtsconfig.json has:
Build Configuration
Vite
ProseKit works out of the box with Vite. No special configuration needed.Next.js
For Next.js, ensure your editor component uses the'use client' directive:
webpack
ProseKit works with webpack 5+. No special configuration needed for basic usage.Troubleshooting
Module not found errors
If you see errors likeCannot find module 'prosekit/react', ensure:
- ProseKit is installed:
npm install prosekit - Your bundler supports package.json
exportsfield - You’re using the correct import path (e.g.,
prosekit/react, notprosekit/dist/react)
Style not applied
If styles aren’t working:- Ensure you’ve imported
prosekit/basic/style.css - Check that your bundler can process CSS imports
- Verify CSS files are being included in your build
TypeScript errors
If you see TypeScript errors:- Ensure you have
@types/nodeinstalled if needed - Check your
tsconfig.jsonhasmoduleResolution: "bundler"or"node16" - Restart your TypeScript server
Next Steps
Now that ProseKit is installed, you’re ready to build your first editor:Quick Start
Get up and running with a basic editor in minutes
First Editor Tutorial
Step-by-step guide to building your first editor
Extensions
Learn about the available extensions
Styling
Customize the appearance of your editor