@wordpress/block-editor package provides the core functionality you need to build standalone editors outside of traditional WordPress contexts.
What You’ll Build
This guide walks you through creating a fully functioning custom block editor with:- Ability to add and edit all Core blocks
- Familiar visual styles and main/sidebar layout
- Basic block persistence between page reloads
Core Concepts
The BlockEditorProvider
<BlockEditorProvider> is the foundation of any block editor instance. It establishes a new block editing context:
BlockList Component
<BlockList> renders the list of blocks in your editor:
<BlockList>loops over all block clientIds<BlockListBlock>renders each individual block<BlockEdit>renders the editable area- The block’s
edit()implementation renders the actual UI
Setting Up Your Editor
Register Core Blocks
Before rendering your editor, register the blocks you want to support:Editor Layout
Create a complete editor layout with regions:Block Persistence
Storing Blocks
Use theonChange handler to persist blocks:
Restoring Blocks
Load blocks when the editor initializes:Inspector Controls
Add a sidebar with block settings using<BlockInspector>: