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-dompnpm add @platejs/slate @platejs/slate-dom @platejs/slate-react react react-domAdd optional packages only when the editor imports them:
pnpm add @platejs/slate-history @platejs/slate-hyperscript @platejs/yjs @platejs/slate-layoutpnpm 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.
| Layer | What it owns |
|---|---|
| Document model | nested JSON nodes, paths, points, ranges, operations, primary children, extra roots, and document state |
| Runtime | editor.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 |
| Proof | browser 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 React | Installing Slate |
| Understand the model | Nodes, then Locations |
| Port commands | Executing Commands, then Commands |
| Store editor values | Saving to a Database and Document State |
| Add schema or custom transactions | Extensions |
| Understand editing behavior | Editing Behavior, then Selection And DOM |
| Handle paste, copy, drop, or fragments | Clipboard And Paste |
| Build comments, highlights, or overlays | Projection And Overlays |
| Test browser editing behavior | Slate Browser |
| Move from upstream Slate 0.x | Migration |
Examples
The examples run inside this docs app:
- Plain text
- Rich text
- Markdown shortcuts
- Checklists
- Editable voids
- Custom placeholder
- Hidden content blocks
- Huge document
- Multi-root document
- Document state
- Yjs collaboration
Use examples for behavior shape. Use the docs pages for the API contract.
Package Map
| Package | Read when |
|---|---|
@platejs/slate | You need the editor runtime, document model, helper APIs, transactions, extensions, or state fields. |
@platejs/slate-dom | You need DOM conversion, clipboard helpers, hotkeys, or browser environment helpers. |
@platejs/slate-react | You render editors with React, use <Editable>, read editor state in components, or build overlays. |
@platejs/slate-history | You need undo/redo and history state. |
@platejs/slate-hyperscript | You write JSX editor fixtures for tests. |
@platejs/yjs | You connect a Slate editor to Yjs document state and awareness. |
@platejs/slate-layout | You build page-layout proof surfaces or paged editor experiments. |
@platejs/browser | You 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.
| Area | Claim |
|---|---|
| Desktop editor behavior | Claimed when package tests and browser proof cover the behavior. |
| Raw mobile device behavior | Deferred until real device proof exists. |
| Pagination | Kept 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 identity | This is Plate's Slate package set, not an official upstream Slate release. |
Read Why This Fork for the maintenance philosophy and hard boundaries.