WordPress.org

WordPress Developer Blog

An introduction to block variations

Block variations are one of the most powerful ways to extend WordPress and curate the editing experience for your users. In this article, you will learn how to effectively create block variations and discover ways to incorporate them into your workflows. Let’s get started.

The Block Variations API

The Block Variations API allows you to create additional versions of existing blocks that differ by a set of initial attributes or inner blocks.

A variation is defined by an object that contains a set of properties. I will cover many of the most important properties in this article, and you can review the rest in the Block Variations API documentation. 

  • name (type string) – A unique and machine-readable name.
  • title (optional, type string) – A human-readable variation title.
  • icon (optional, type string