Top Related Projects
ProseMirror toolkit for React 🎉
A completely customizable framework for building rich text editors. (Currently in beta.)
The headless rich text editor framework for web artisans.
Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
The ProseMirror WYSIWYM editor
Quill is a modern WYSIWYG editor built for compatibility and extensibility
Quick Overview
Plate is a plugin-based rich text editor framework for React. It provides a customizable and extensible foundation for building advanced text editing experiences, leveraging the power of React and TypeScript.
Pros
- Highly customizable and extensible through a plugin system
- Built with TypeScript, offering strong typing and improved developer experience
- Supports real-time collaboration out of the box
- Offers a wide range of pre-built plugins for common editing features
Cons
- Steeper learning curve compared to simpler WYSIWYG editors
- Documentation could be more comprehensive for advanced use cases
- May be overkill for simple text editing needs
- Requires additional setup and configuration compared to ready-to-use editors
Code Examples
Creating a basic Plate editor:
import React from 'react';
import { createPlateUI, Plate, PlateProvider } from '@udecode/plate';
const initialValue = [
{
type: 'p',
children: [{ text: 'Hello, Plate!' }],
},
];
const Editor = () => (
<PlateProvider initialValue={initialValue}>
<Plate editableProps={{ placeholder: 'Type something...' }} />
</PlateProvider>
);
Adding basic formatting plugins:
import {
createBoldPlugin,
createItalicPlugin,
createUnderlinePlugin,
} from '@udecode/plate';
const plugins = [
createBoldPlugin(),
createItalicPlugin(),
createUnderlinePlugin(),
];
const Editor = () => (
<PlateProvider plugins={plugins} initialValue={initialValue}>
<Plate editableProps={{ placeholder: 'Type something...' }} />
</PlateProvider>
);
Customizing the toolbar:
import { Toolbar, MarkToolbarButton } from '@udecode/plate';
const MyToolbar = () => (
<Toolbar>
<MarkToolbarButton type="bold" icon={<BoldIcon />} />
<MarkToolbarButton type="italic" icon={<ItalicIcon />} />
<MarkToolbarButton type="underline" icon={<UnderlineIcon />} />
</Toolbar>
);
const Editor = () => (
<PlateProvider plugins={plugins} initialValue={initialValue}>
<MyToolbar />
<Plate editableProps={{ placeholder: 'Type something...' }} />
</PlateProvider>
);
Getting Started
-
Install Plate and its core dependencies:
npm install @udecode/plate slate slate-react react react-dom
-
Create a basic editor component:
import React from 'react'; import { createPlateUI, Plate, PlateProvider } from '@udecode/plate'; const Editor = () => ( <PlateProvider> <Plate editableProps={{ placeholder: 'Type something...' }} /> </PlateProvider> ); export default Editor;
-
Use the editor component in your app:
import React from 'react'; import Editor from './Editor'; const App = () => ( <div> <h1>My Plate Editor</h1> <Editor /> </div> ); export default App;
Competitor Comparisons
ProseMirror toolkit for React 🎉
Pros of Remirror
- More extensive documentation and examples
- Larger community and ecosystem with more extensions
- Better TypeScript support and type safety
Cons of Remirror
- Steeper learning curve due to its complexity
- Heavier bundle size compared to Plate
- Less flexibility in customizing the core editor behavior
Code Comparison
Remirror:
import { useRemirror } from '@remirror/react';
const { manager, state, onChange } = useRemirror({
extensions: () => [new BoldExtension(), new ItalicExtension()],
content: '<p>Hello World!</p>',
selection: 'end',
});
Plate:
import { createPlateUI, createPlugins, Plate } from '@udecode/plate';
const plugins = createPlugins([
createBoldPlugin(),
createItalicPlugin(),
]);
<Plate plugins={plugins} initialValue={[{ children: [{ text: 'Hello World!' }] }]} />;
Both Remirror and Plate are powerful rich text editing libraries for React applications. Remirror offers a more comprehensive set of features and extensions, making it suitable for complex editing needs. However, this comes at the cost of a steeper learning curve and larger bundle size. Plate, on the other hand, provides a more lightweight and flexible approach, allowing for easier customization of core editor behavior. The choice between the two depends on the specific requirements of your project and the level of complexity you're willing to manage.
A completely customizable framework for building rich text editors. (Currently in beta.)
Pros of Slate
- More mature and established project with a larger community
- Extensive documentation and examples
- Highly customizable and flexible architecture
Cons of Slate
- Steeper learning curve for beginners
- Requires more boilerplate code to get started
- Less opinionated, which can lead to inconsistent implementations
Code Comparison
Slate:
import { createEditor } from 'slate'
import { Slate, Editable, withReact } from 'slate-react'
const editor = withReact(createEditor())
const initialValue = [{ children: [{ text: 'Hello world!' }] }]
const MyEditor = () => (
<Slate editor={editor} value={initialValue}>
<Editable />
</Slate>
)
Plate:
import { createPlateUI, Plate } from '@udecode/plate'
const initialValue = [{ children: [{ text: 'Hello world!' }] }]
const MyEditor = () => (
<Plate initialValue={initialValue} plugins={createPlateUI()}>
<PlateContent />
</Plate>
)
Both Slate and Plate are powerful rich text editing frameworks for React. Slate offers more flexibility and customization options, while Plate provides a more opinionated and streamlined approach with pre-built components and plugins. Slate may be better suited for complex, highly customized editors, while Plate can help developers get up and running quickly with a polished editor experience.
The headless rich text editor framework for web artisans.
Pros of Tiptap
- More mature and established project with a larger community
- Extensive documentation and examples
- Built-in support for collaborative editing
Cons of Tiptap
- Steeper learning curve, especially for complex customizations
- Requires more setup and configuration for advanced features
- Limited built-in components compared to Plate
Code Comparison
Tiptap:
import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'
new Editor({
element: document.querySelector('.editor'),
extensions: [StarterKit],
})
Plate:
import { createPlateUI, createPlugins, Plate } from '@udecode/plate'
const plugins = createPlugins([...])
const components = createPlateUI()
<Plate plugins={plugins} components={components}>
{children}
</Plate>
Both Tiptap and Plate are powerful rich text editing libraries for React applications. Tiptap offers a more established ecosystem with extensive documentation and collaborative editing support. However, it may require more setup and have a steeper learning curve. Plate, on the other hand, provides a more straightforward API and a wider range of built-in components, making it easier to get started quickly. The choice between the two depends on specific project requirements and developer preferences.
Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
Pros of Lexical
- Developed and maintained by Facebook, ensuring robust support and regular updates
- Highly performant and optimized for large documents and complex editing scenarios
- Extensive documentation and examples available for developers
Cons of Lexical
- Steeper learning curve due to its low-level nature and custom data model
- Less out-of-the-box features compared to Plate, requiring more custom implementation
- Smaller ecosystem of plugins and extensions
Code Comparison
Lexical:
import {$getRoot, $createParagraphNode, $createTextNode} from 'lexical';
editor.update(() => {
const root = $getRoot();
const paragraph = $createParagraphNode();
const text = $createTextNode('Hello world');
paragraph.append(text);
root.append(paragraph);
});
Plate:
import { createPlateUI, createPlugins, Plate } from '@udecode/plate';
const plugins = createPlugins([...]);
const MyEditor = () => (
<Plate plugins={plugins} initialValue={[{ type: 'p', children: [{ text: 'Hello world' }] }]}>
{/* editor content */}
</Plate>
);
This comparison highlights the different approaches: Lexical's imperative style versus Plate's declarative React-based implementation. Lexical offers more fine-grained control, while Plate provides a higher-level abstraction for quicker setup and easier integration with React applications.
The ProseMirror WYSIWYM editor
Pros of ProseMirror
- Mature and battle-tested framework with a large community
- Highly customizable and extensible architecture
- Robust documentation and extensive ecosystem of plugins
Cons of ProseMirror
- Steeper learning curve due to its low-level nature
- Requires more setup and configuration for basic functionality
- Less opinionated, which can lead to more decision-making for developers
Code Comparison
ProseMirror:
import {EditorState} from "prosemirror-state"
import {EditorView} from "prosemirror-view"
import {Schema} from "prosemirror-model"
const schema = new Schema({
nodes: {
doc: {content: "block+"},
paragraph: {group: "block"},
text: {inline: true}
}
})
const state = EditorState.create({schema})
const view = new EditorView(document.body, {state})
Plate:
import React from 'react'
import { createPlateUI, Plate } from '@udecode/plate'
const initialValue = [
{
type: 'p',
children: [{ text: 'Hello, World!' }],
},
]
const MyEditor = () => (
<Plate initialValue={initialValue} />
)
The code comparison shows that Plate offers a more React-centric and declarative approach, while ProseMirror provides a lower-level API for creating and managing the editor state.
Quill is a modern WYSIWYG editor built for compatibility and extensibility
Pros of Quill
- More mature and established project with a larger community
- Extensive documentation and examples available
- Wider range of built-in features and modules
Cons of Quill
- Heavier and more complex, which may impact performance
- Less flexible for custom configurations and extensions
- Steeper learning curve for developers new to rich text editing
Code Comparison
Quill:
var quill = new Quill('#editor', {
modules: { toolbar: true },
theme: 'snow'
});
Plate:
const editor = withReact(
createEditor(),
withHistory,
withPlate()
);
Plate offers a more modular approach, allowing developers to compose plugins and customize the editor more easily. Quill provides a more opinionated structure with pre-configured modules.
While Quill has been the go-to choice for many projects due to its maturity and feature set, Plate is gaining traction for its flexibility and modern React-based architecture. The choice between the two depends on specific project requirements, desired customization level, and developer preferences.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Plate
Templates
You can choose one of the following templates to get started:
Option | Plate | Plugins | AI | Backend |
---|---|---|---|---|
Notion-like template | â | â | â | â |
Plate playground template | â | â | â | |
Plate minimal template | â |
Documentation
You can learn more about Plate by checking out our documentation.
Contributing
To get started, check out our contributing guide.
Contributors
We'd love for you to join us! Whether it's through giving us a ð star, making a ð¥ pull request, or sharing your plugins, your help is always appreciated.
Need more help? Join us on Discord. We're always here to guide you.
ä¸æææ¡£
æ¨å¯ä»¥éè¿æ¥çæä»¬çä¸æææ¡£äºè§£æ´å¤å ³äºPlateçä¿¡æ¯ã妿æ¨éè¦ä¸ææ¯æï¼æ¬¢è¿å å ¥æä»¬çDiscord䏿é¢éï¼æä»¬çç¤¾åºæåå°å¾ä¹æç¨ä¸æä¸ºæ¨è§£çé®é¢ã
对äºè´¡ç®è ï¼æä»¬ä¹æä¾äºä¸æè´¡ç®æåï¼å¸®å©æ¨åä¸å°Plateçå¼åä¸ã
Top Related Projects
ProseMirror toolkit for React 🎉
A completely customizable framework for building rich text editors. (Currently in beta.)
The headless rich text editor framework for web artisans.
Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
The ProseMirror WYSIWYM editor
Quill is a modern WYSIWYG editor built for compatibility and extensibility
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot