Overview

PreviousNext

Slate editor runtime docs for the Plate-maintained package set.

Slate is a JSON editor runtime for building product-specific rich text editors. This docs section covers the Plate-maintained Slate packages, their React renderer, their browser proof harness, and the boundaries that keep the runtime verifiable. Start here when you want the current package shape, not upstream Slate 0.x compatibility notes.

On This Page

Install

Install the React editor path first:

pnpm add @platejs/slate @platejs/slate-dom @platejs/slate-react react react-dom
pnpm add @platejs/slate @platejs/slate-dom @platejs/slate-react react react-dom

Add optional packages only when the editor imports them:

pnpm add @platejs/slate-history @platejs/slate-hyperscript @platejs/yjs @platejs/slate-layout
pnpm add @platejs/slate-history @platejs/slate-hyperscript @platejs/yjs @platejs/slate-layout

@platejs/browser is the browser proof package. Use it in tests and proof harnesses, not as the product editing API.

Core Shape

Slate gives you a document model, an explicit runtime, and React rendering hooks.

LayerWhat it owns
Document modelnested JSON nodes, paths, points, ranges, operations, primary children, extra roots, and document state
Runtimeeditor.read(...), editor.update(...), transactions, commits, normalization, refs, history integration, and extension groups
React<Slate>, <Editable>, render functions, editor hooks, DOM repair, selection sync, overlays, and root-aware chrome
Proofbrowser tests that check model state, rendered DOM, native selection where observable, focus, replay, and follow-up typing

The first editor usually looks like this:

import { Editable, Slate, useSlateEditor } from "@platejs/slate-react";
 
const initialValue = [
  {
    type: "paragraph",
    children: [{ text: "A line of text." }],
  },
];
 
export function Editor() {
  const editor = useSlateEditor({ initialValue });
 
  return (
    <Slate editor={editor}>
      <Editable placeholder="Start typing..." />
    </Slate>
  );
}
import { Editable, Slate, useSlateEditor } from "@platejs/slate-react";
 
const initialValue = [
  {
    type: "paragraph",
    children: [{ text: "A line of text." }],
  },
];
 
export function Editor() {
  const editor = useSlateEditor({ initialValue });
 
  return (
    <Slate editor={editor}>
      <Editable placeholder="Start typing..." />
    </Slate>
  );
}

Reads stay explicit:

const value = editor.read((state) => state.value.get());
const value = editor.read((state) => state.value.get());

Writes stay explicit:

editor.update((tx) => {
  tx.text.insert("Hello");
});
editor.update((tx) => {
  tx.text.insert("Hello");
});

Pick A First Path

If you want to...Start with
Render one editor in ReactInstalling Slate
Understand the modelNodes, then Locations
Port commandsExecuting Commands, then Commands
Store editor valuesSaving to a Database and Document State
Add schema or custom transactionsExtensions
Understand editing behaviorEditing Behavior, then Selection And DOM
Handle paste, copy, drop, or fragmentsClipboard And Paste
Build comments, highlights, or overlaysProjection And Overlays
Test browser editing behaviorSlate Browser
Move from upstream Slate 0.xMigration

Examples

The examples run inside this docs app:

Use examples for behavior shape. Use the docs pages for the API contract.

Package Map

PackageRead when
@platejs/slateYou need the editor runtime, document model, helper APIs, transactions, extensions, or state fields.
@platejs/slate-domYou need DOM conversion, clipboard helpers, hotkeys, or browser environment helpers.
@platejs/slate-reactYou render editors with React, use <Editable>, read editor state in components, or build overlays.
@platejs/slate-historyYou need undo/redo and history state.
@platejs/slate-hyperscriptYou write JSX editor fixtures for tests.
@platejs/yjsYou connect a Slate editor to Yjs document state and awareness.
@platejs/slate-layoutYou build page-layout proof surfaces or paged editor experiments.
@platejs/browserYou write browser-level editor proof.

Proof Boundary

This package set is unpublished beta documentation. Treat the runtime as current, but do not treat every adjacent editor problem as solved.

AreaClaim
Desktop editor behaviorClaimed when package tests and browser proof cover the behavior.
Raw mobile device behaviorDeferred until real device proof exists.
PaginationKept in @platejs/slate-layout and example lanes; not the core editor promise.
Collaboration@platejs/yjs owns Slate/Yjs mapping. Apps own providers, auth, persistence, and rooms.
Upstream identityThis is Plate's Slate package set, not an official upstream Slate release.

Read Why This Fork for the maintenance philosophy and hard boundaries.