From 754c472186fbb2afe823ef5f9c8e01c9b6fd825a Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Wed, 13 May 2020 17:09:28 +0800 Subject: [PATCH] Update block editor docs (#22308) --- packages/block-editor/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index 48f4fad4bdff63..ebcc6809a8d4b2 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -33,6 +33,7 @@ function MyEditorComponent () { onInput={ updateBlocks } onChange={ updateBlocks } > + @@ -48,12 +49,14 @@ function MyEditorComponent () { // import '@wordpress/block-editor/build-style/style.css'; ``` -In this example, we're instantiating a block editor. A block editor is composed by a `BlockEditorProvider` wrapper component where you passe the current array of blocks and on each change the `onInput` or `onChange` callbacks are called depending on whether the change is considered persistent or not. +In this example, we're instantiating a block editor. A block editor is composed by a `BlockEditorProvider` wrapper component where you pass the current array of blocks and on each change the `onInput` or `onChange` callbacks are called depending on whether the change is considered persistent or not. Inside `BlockEditorProvider`, you can nest any of the available `@wordpress/block-editor` UI components to build the UI of your editor. In the example above we're rendering the `BlockList` to show and edit the block list. For instance we could add a custom sidebar and use the `BlockInspector` component to be able to edit the advanced settings for the currently selected block. (See the [API](#API) for the list of all the available components). +The `Popover.Slot` with the `name="block-toolbar"` prop is used to render the toolbar for a selected block. + In the example above, there's no registered block type, in order to use the block editor successfully make sure to register some block types. For instance, registering the core block types can be done like so: ```js