Block API Reference

In previous topics, you have gone through the following Block APIs.

Go through the following documentation to explore other Block APIs.

Block Styles allow alternative styles to be applied to existing blocks.

A block template is defined as a list of block items. Such blocks can have predefined attributes, placeholder content, and be static or dynamic. Block templates allow specifying a default initial state for an editor session.

Patterns Block Patterns are predefined block layouts, available from the patterns tab of the block inserter. Once inserted into content, the blocks are ready for additional or modified content and configuration.

Block Variations is the API that allows a block to have similar versions of it, but all these versions share some common functionality. Each block variation is differentiated from the others by setting some initial attributes or inner blocks. Then at the time when a block is inserted these attributes and/or inner blocks are applied.

Deprecation provides a “deprecated” version of the block allowing users opening old versions of their block in the block editor to edit them using the updated block.

Block Transforms is the API that allows a block to be transformed from and to other blocks, as well as from other entities.

Block context is a feature which enables ancestor blocks to provide values which can be consumed by descendent blocks within its own hierarchy. Those descendent blocks can inherit these values without resorting to hard-coded values and without an explicit awareness of the block which provides those values.

Annotations are a way to highlight a specific piece in a post created with the block editor. Examples of this include commenting on a piece of text and spell checking. Both can use the annotations API to mark a piece of text.