Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions packages/block-editor/src/components/block-list/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Block List

The `BlockList` component is responsible for rendering a list of blocks within the WordPress block editor. It manages the layout, interactions, and UI behaviors for blocks within the editor interface.

## Usage

This component is used internally within the WordPress block editor and is not typically used directly by block developers. It renders blocks inside a parent container, applying necessary UI behaviors such as selection handling, focus management, and appender display.

### Example

```jsx
import BlockList from '@wordpress/block-editor/components/block-list';

@im3dabasia im3dabasia Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’d be nice to replace this with the one below.

import { BlockList } from '@wordpress/block-editor';


function MyEditorComponent( props ) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example can be misleading because it doesn’t show the full picture of how this component can be used. Perhaps we could present it as just one example. What do you think?

import { BlockCanvas, BlockEditorProvider, BlockList } from '@wordpress/block-editor';

<BlockEditorProvider value={ blocks } onChange={ setBlocks }>
	<BlockCanvas height="400px">
		<BlockList className="my-editor-block-list" />
	</BlockCanvas>
</BlockEditorProvider>;

Picked from here

return (
<BlockList rootClientId={ props.clientId } />
);
}
```

## Props

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we switch from the tabular format to per-prop subheadings with type/default bullets? This would help us achieve consistency!


| Prop | Type | Description |
|---------------------------|------------|-------------|
| `rootClientId` | `string?` | The client ID of the root block whose inner blocks will be rendered. If omitted, renders the top-level blocks. |
| `placeholder` | `ReactNode?` | Placeholder content displayed when no blocks are present. |
| `renderAppender` | `Function?` | Custom function to render an appender component (e.g., the "+" button for adding new blocks). Defaults to the standard block appender. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renderAppender accepts false to suppress the appender entirely . Currently the table only describes the function form. It'd be a nice idea to mention this as well.

Ref usage in style-book

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also have a missing className prop. Please add it here, as it is directly consumed by the BlockList component.

| `__experimentalAppenderTagName` | `string?` | Tag name for the appender element. |
| `layout` | `Object?` | The layout configuration for blocks, affecting their positioning and arrangement. |

## Features

- **Block Rendering:** Displays a list of blocks based on the provided `rootClientId`.
- **Selection & Focus Handling:** Manages block selection, focus state, and block visibility.
- **Zoom-Out Mode:** Provides UI behavior for zooming out from nested block structures.
- **Block Editing Mode Integration:** Supports different block editing modes, including content-only editing and disabled states.
- **Block Appender Support:** Displays an appender UI when appropriate, allowing users to insert new blocks.

## Related Components

- [`BlockListBlock`](./block) - Renders individual blocks within the `BlockList`.
- [`BlockListAppender`](../block-list-appender) - Provides UI for adding new blocks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BlockListBlock and BlockListAppender don't have READMEs of their own, so these would end up as dead links once this is published.

Might be better to mention them as plain text for now, and link them up if/when those READMEs get added.

- [`useInnerBlocksProps`](../inner-blocks) - Hook for managing inner blocks and their props.

## Notes

The `BlockList` component plays a crucial role in structuring the block editor. While it is used internally, developers working on extending or modifying the editor interface may need to interact with it for advanced customization.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notes isn't a heading used anywhere else in this package, and the content here mostly repeats the opening of Usage above. Could the one new bit be folded into the intro paragraph and the section dropped?

Same thought for Features, most of the READMEs here use Development guidelines for that kind of prose.

Loading