Skip to main content
The Block Supports API allows blocks to declare support for certain editor features. When you enable a support feature, the editor automatically:
  1. Registers additional attributes on the block
  2. Provides UI controls in the editor
  3. Applies the settings through useBlockProps
This eliminates the need to manually build controls for common features.

How Block Supports Work

Declare supports in your block.json:
Then use useBlockProps to apply the generated properties:

Color Support

object
Enables color-related controls and attributes

Background Color

This automatically adds:
  • backgroundColor attribute (string) - Stores preset slug
  • style.color.background attribute - Stores custom color value
  • Color picker UI in the editor

Text Color

Adds:
  • textColor attribute - Preset slug
  • style.color.text attribute - Custom value

Gradients

Adds:
  • gradient attribute - Preset gradient slug
  • style.color.gradient attribute - Custom gradient
Available since WordPress 6.5

Real Example: Paragraph Block

From packages/block-library/src/paragraph/block.json:

Spacing Support

object
Enables margin, padding, and blockGap controls

Margin and Padding

Specific Sides

Control which sides can be adjusted:
Options:
  • Individual sides: top, right, bottom, left
  • Axial pairs: horizontal, vertical

Block Gap

blockGap only works on blocks that also use the layout support.

Real Example: Group Block

From packages/block-library/src/group/block.json:

Typography Support

object
Enables font-size, line-height, and other text controls

Font Size

Adds:
  • fontSize attribute - Preset size slug
  • style.typography.fontSize attribute - Custom value

Line Height

Adds:
  • style.typography.lineHeight attribute

Text Alignment

Available since WordPress 6.6
Or limit to specific alignments:

Real Example: Button Block

From packages/block-library/src/button/block.json:

Border Support

object
Enables border color, radius, style, and width controls
From packages/block-library/src/paragraph/block.json:

Dimensions Support

Available since WordPress 6.2
object
Controls for width, height, min-height, and aspect-ratio
Stores values in:

Alignment Support

boolean | array
Enable block alignment controls
Or specific alignments:
Adds align attribute automatically. From packages/block-library/src/paragraph/block.json:

Layout Support

boolean | object
For container blocks with inner blocks

Layout Types

  • flow - Default vertical stacking
  • flex - Flexbox layout
  • constrained - Centered content with max-width

Real Example: Columns Block

From packages/block-library/src/columns/block.json:

Anchor Support

boolean
default:"false"
Allows users to define a custom HTML anchor/ID
Adds anchor attribute and UI field for setting an ID.

HTML Editing

boolean
default:"true"
Allow editing block markup as HTML

Multiple Instances

boolean
default:"true"
Allow inserting block more than once

Reusable

boolean
default:"true"
Allow converting to a reusable block

Inserter Visibility

boolean
default:"true"
Show block in the inserter

Class Name

boolean
default:"true"
Add automatic .wp-block-namespace-name class

Custom Class Name

boolean
default:"true"
Allow users to add custom CSS classes

Lock Support

boolean
default:"true"
Allow users to lock/unlock the block

Renaming

Available since WordPress 6.5
boolean
default:"true"
Allow users to rename the block

Position Support

Available since WordPress 6.2
Stores values in:

Shadow Support

Available since WordPress 6.5
Stores value in style.shadow attribute.

Background Support

Available since WordPress 6.5
Stores in:

Interactivity API

boolean | object
Indicates Interactivity API compatibility
Or simply:

Combining Multiple Supports

Real-world example from the core Paragraph block:

Accessing Support Values

Check if a block supports a feature:

Best Practices

Leverage block supports for common features rather than implementing custom attributes and controls.
Use __experimentalDefaultControls to show important controls by default while hiding advanced options.
Some supports require theme opt-in via theme.json. Document any theme requirements for your blocks.

Next Steps

Block Patterns

Create reusable block layouts

Inner Blocks

Build container blocks