The goal of this example is to show how the component InnerBlocks allows to create custom blocks that accepts other blocks inside.
| Example | Description | Tags | Download .zip | Live Demo |
|---|---|---|---|---|
| Inner Blocks | Demonstrates how to create blocks that can contain other blocks using InnerBlocks component. | 📦 |
At edit.js we can see how we import InnerBlocks from @wordpress/block-editor and use it inside our Edit component by setting a specific "template" for this block every time is inserted. From block.json we define the "allowedBlocks" that are allowed to be inserted within the InnerBlocks part of the block.
Note Check the Start Guide for local development with the examples