From zbeyens. The source code is available on GitHub.

Plate
PlatePliteEditorsTemplates
GitHub16kGitHub
DiscordDiscord
  • Examples
    • Plate to HTML
    • Export
    • Server-Side
    • Version History
    • Editable Voids
    • Huge Document
    • Hundreds Editors
    • Markdown Streaming
    • Preview Markdown
    • Collaboration Demo
    • Table Nomerge Demo
    • Excalidraw Demo
    • Code Drawing Demo
    • Single Block Demo
    • List Classic Demo
    • Find Replace Demo
    • AI Demo
    • Align Demo
    • Autoformat Demo
    • Basic Nodes Demo
    • Block Menu Demo
    • Node Selection Demo
    • Column Demo
    • Code Block Demo
    • Callout Demo
    • Discussion Demo
    • Cursor Overlay Demo
    • Date Demo
    • Footnote Demo
    • Drag & Drop Demo
    • Emoji Demo
    • Equation Demo
    • Exit Break Demo
    • Floating Toolbar Demo
    • Font Demo
    • Indent Demo
    • List Demo
    • Line Height Demo
    • Link Demo
    • Media Demo
    • Mention Demo
    • Block Placeholder Demo
    • Serializing CSV Demo
    • Serializing Docx Demo
    • Serializing HTML Demo
    • Serializing Markdown Demo
    • Slash Command Demo
    • Plugin Rules Demo
    • Table Demo
    • Table of Contents Demo
    • Toggle Demo

Hundreds Editors

PreviousNext

Render many independent Plate editors on one page.

This example mounts 300 separate Plate editors in a single React tree. Each editor gets its own id and value, so the page stresses editor creation, store isolation, and repeated editable surfaces.

Demo

Loading…

Source

The demo maps generated values to <WithPlate id={idx + 1} value={value} />.

'use client';
 
import type { Value } from 'platejs';
import { Plate, usePlateEditor } from 'platejs/react';
import * as React from 'react';
 
import { Editor, EditorContainer } from '@/components/editor/editor';
import { createMultiEditorsValue } from '@/registry/examples/values/multi-editors-value';
 
const editors = createMultiEditorsValue().map((value, index) => ({
  id: String(index + 1),
  value,
}));
 
function



























Value Generator

Each generated editor value contains one heading and two paragraphs.

/** @jsxRuntime classic */
/** @jsx jsx */
import { jsx } from '@platejs/test-utils';
import type { Element, Value } from 'platejs';
 
jsx;
 
export const createMultiEditorsValue = () => {
  const multiEditors: Value[] = [];
 
  for (let h = 0; h < 300; h++) {
    const multiEditor: Element[] = [];
    multiEditor.push(
      <

























Runtime Shape

SurfaceOwnerNotes
createMultiEditorsValue()Registry exampleCreates 300 editor values with JSX test-utils syntax.
WithPlateRegistry exampleCalls usePlateEditor({ id, value }) for each editor.
<Plate>platejs/reactCreates one editor store provider per editor instance.
<EditorContainer> / <Editor>Registry UIRenders the shared editor shell for every instance.

Use this demo to inspect many-editor mounting cost, store isolation, and focus behavior. It is a browser stress page, not a production layout recommendation.

Related

  • Plate Components covers <Plate> and editor store providers.
  • Plate Controller covers cross-editor coordination.
  • Plate Store covers scoped editor store access.
Huge DocumentMarkdown Streaming

On This Page

DemoSourceValue GeneratorRuntime ShapeRelated
Build your editor
Production-ready AI template and reusable components.
Get all-access
WithPlate
({
id
,
value
}
:
{
id
:
string
;
value
:
Value
}) {
const editor = usePlateEditor({
id,
// components: PlateUI,
// plugins: [...BasicBlocksKit, ...BasicMarksKit],
initialValue: value,
});
return (
<Plate editor={editor}>
<EditorContainer>
<Editor spellCheck={false} />
</EditorContainer>
</Plate>
);
}
export default function HundredsEditorsDemo() {
return (
<div className="flex flex-col">
{editors.map(({ id, value }) => (
<div key={id} className="p-10">
<h3 className="mb-2 font-semibold">#{id}</h3>
<WithPlate id={id} value={value} />
</div>
))}
</div>
);
}
'use client';
 
import type { Value } from 'platejs';
import { Plate, usePlateEditor } from 'platejs/react';
import * as React from 'react';
 
import { Editor, EditorContainer } from '@/components/editor/editor';
import { createMultiEditorsValue } from '@/registry/examples/values/multi-editors-value';
 
const editors = createMultiEditorsValue().map((value, index) => ({
  id: String(index + 1),
  value,
}));
 
function WithPlate({ id, value }: { id: string; value: Value }) {
  const editor = usePlateEditor({
    id,
    // components: PlateUI,
    // plugins: [...BasicBlocksKit, ...BasicMarksKit],
    initialValue: value,
  });
 
  return (
    <Plate editor={editor}>
      <EditorContainer>
        <Editor spellCheck={false} />
      </EditorContainer>
    </Plate>
  );
}
 
export default function HundredsEditorsDemo() {
  return (
    <div className="flex flex-col">
      {editors.map(({ id, value }) => (
        <div key={id} className="p-10">
          <h3 className="mb-2 font-semibold">#{id}</h3>
          <WithPlate id={id} value={value} />
        </div>
      ))}
    </div>
  );
}
hheading
level
=
{
1
}>Amet duis nisi ea enim laborum laboris.</
hheading
>
);
for (let p = 0; p < 2; p++) {
multiEditor.push(
<hp>
Laborum dolor et tempor consectetur amet ullamco consectetur ullamco
irure incididunt reprehenderit ullamco nulla tempor. Laboris veniam
commodo id in ex ullamco incididunt nulla eu Lorem adipisicing
deserunt duis ad. Mollit magna enim exercitation amet proident
reprehenderit magna nulla officia ad in non. Magna magna adipisicing
fugiat cillum do esse eu adipisicing. Culpa dolor non Lorem. Dolore
non voluptate velit in eu culpa velit. Exercitation fugiat cupidatat
adipisicing duis veniam proident irure ea excepteur aliqua esse ad
cupidatat adipisicing id. Ut exercitation proident ea eiusmod enim non
minim proident Lorem aliqua officia voluptate ullamco culpa Lorem.
Exercitation eiusmod dolor nostrud qui excepteur. Dolor commodo duis
reprehenderit excepteur laboris do minim qui.
</hp>
);
}
multiEditors.push(multiEditor);
}
return multiEditors;
};
/** @jsxRuntime classic */
/** @jsx jsx */
import { jsx } from '@platejs/test-utils';
import type { Element, Value } from 'platejs';
 
jsx;
 
export const createMultiEditorsValue = () => {
  const multiEditors: Value[] = [];
 
  for (let h = 0; h < 300; h++) {
    const multiEditor: Element[] = [];
    multiEditor.push(
      <hheading level={1}>Amet duis nisi ea enim laborum laboris.</hheading>
    );
 
    for (let p = 0; p < 2; p++) {
      multiEditor.push(
        <hp>
          Laborum dolor et tempor consectetur amet ullamco consectetur ullamco
          irure incididunt reprehenderit ullamco nulla tempor. Laboris veniam
          commodo id in ex ullamco incididunt nulla eu Lorem adipisicing
          deserunt duis ad. Mollit magna enim exercitation amet proident
          reprehenderit magna nulla officia ad in non. Magna magna adipisicing
          fugiat cillum do esse eu adipisicing. Culpa dolor non Lorem. Dolore
          non voluptate velit in eu culpa velit. Exercitation fugiat cupidatat
          adipisicing duis veniam proident irure ea excepteur aliqua esse ad
          cupidatat adipisicing id. Ut exercitation proident ea eiusmod enim non
          minim proident Lorem aliqua officia voluptate ullamco culpa Lorem.
          Exercitation eiusmod dolor nostrud qui excepteur. Dolor commodo duis
          reprehenderit excepteur laboris do minim qui.
        </hp>
      );
    }
 
    multiEditors.push(multiEditor);
  }
 
  return multiEditors;
};