platejs is the umbrella package for Plate's base, React, and static APIs. It re-exports the core runtime, Plite runtime, utilities, React helpers, and static renderer through three public subpaths.
platejs has React peer dependencies because the package also owns platejs/react.
| Import |
|---|
| Re-exports |
|---|
| Use |
|---|
platejs | @platejs/core, @platejs/plite, @platejs/utils, @udecode/utils | Headless editor creation, Plite APIs, core types, and shared utilities. |
platejs/react | @platejs/core/react, @platejs/utils/react, @udecode/react-hotkeys, @udecode/react-utils | React editors, components, hooks, stores, plugins, and React utility hooks. |
platejs/static | @platejs/core/static | Static editor creation, React-based HTML rendering, and static node renderers. |
Use the umbrella imports in application code. Package code can import direct package surfaces such as @platejs/core/react when it needs a tighter dependency boundary.
Use platejs for non-React editor work and shared types.
import { createBaseEditor } from 'platejs';
export const editor = createBaseEditor({
initialValue: [
{
type: 'paragraph',
children: [{ text: 'Headless editor.' }],
},
],
});import { createBaseEditor } from 'platejs';
export const editor = createBaseEditor({
initialValue: [
{
type: 'paragraph',
children: [{ text: 'Headless editor.' }],
},
],
});Use platejs/react for app editors.
import { Plate, PlateContent, usePlateEditor } from 'platejs/react';
export function BasicEditor() {
const editor = usePlateEditor({
initialValue: [
{
type: 'paragraph',
children: [{ text: 'React editor.' }],
},
],
});
return (
<Plate editor={editor}>
<PlateContent />
</Plate>
);
}import { Plate, PlateContent, usePlateEditor } from 'platejs/react';
export function BasicEditor() {
const editor = usePlateEditor({
initialValue: [
{
type: 'paragraph',
children: [{ text: 'React editor.' }],
},
],
});
return (
<Plate editor={editor}>
<PlateContent />
</Plate>
);
}Use platejs/static for rendering or serialization paths that do not mount an editable React editor.
import { createStaticEditor } from 'platejs/static';
export const staticEditor = createStaticEditor({
initialValue: [
{
type: 'paragraph',
children: [{ text: 'Static editor.' }],
},
],
});import { createStaticEditor } from 'platejs/static';
export const staticEditor = createStaticEditor({
initialValue: [
{
type: 'paragraph',
children: [{ text: 'Static editor.' }],
},
],
});| Page | Covers |
|---|---|
| Plate Core | Editor creation, React runtime, plugins, stores, and render primitives. |
| Plite | Plite-compatible editor API, transforms, nodes, locations, operations, and refs. |
| Plate Utils | Shared non-React utilities. |
| React Utils | React utility hooks and helpers re-exported through platejs/react. |
| Plate Components | Plate, PlateContent, PlateView, and component primitives. |
| Plate Editor | Runtime editor type, core APIs, transforms, DOM state, and metadata. |