Skip to content
This page is available as Markdown at /editor.md. For the full documentation index, see /llms.txt, or the complete corpus at /llms-full.txt.

Portable Text Editor

The Portable Text Editor (@portabletext/editor) is the officially supported editor for working with Portable Text content. It’s a headless block content editor for React: you bring the UI, the editor handles the editing.

You configure the editor by declaring a schema of styles, decorators, annotations, lists, block objects, and inline objects. Rendering is yours to control through node registrations and render props on PortableTextEditable, and containers let structures like callouts, code blocks, and tables carry editable rich text. Interactions are extensible through the Behavior API and a growing set of plugins. The companion @portabletext/toolbar package gives you headless hooks for building toolbar UI.

Install the editor, define a schema, and build your first toolbar.

How the schema, decorators, annotations, containers, and behaviors fit together.

Practical walkthroughs: custom blocks and inline objects, custom rendering, building toolbars, writing behaviors, and testing.

API documentation for the editor, behaviors, plugins, selectors, toolbar, and keyboard shortcuts.