Convert Figma logo to code with AI

udecode logoplate

A rich-text editor powered by AI

13,362
814
13,362
95

Top Related Projects

ProseMirror toolkit for React 🎉

30,635

A completely customizable framework for building rich text editors. (Currently in beta.)

30,004

The headless rich text editor framework for web artisans.

21,085

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.

The ProseMirror WYSIWYM editor

45,226

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

  1. Install Plate and its core dependencies:

    npm install @udecode/plate slate slate-react react react-dom
    
  2. 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;
    
  3. 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.

30,635

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.

30,004

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.

21,085

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.

45,226

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 Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Plate

Total Downloads PRs Welcome

hero

Templates

You can choose one of the following templates to get started:

OptionPlatePluginsAIBackend
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.

Star History Chart

Need more help? Join us on Discord. We're always here to guide you.

中文文档

您可以通过查看我们的中文文档了解更多关于Plate的信息。如果您需要中文支持,欢迎加入我们的Discord中文频道,我们的社区成员将很乐意用中文为您解答问题。

对于贡献者,我们也提供了中文贡献指南,帮助您参与到Plate的开发中。

NPM DownloadsLast 30 Days