- Registers additional attributes on the block
- Provides UI controls in the editor
- Applies the settings through
useBlockProps
How Block Supports Work
Declare supports in yourblock.json:
useBlockProps to apply the generated properties:
Color Support
object
Enables color-related controls and attributes
Background Color
backgroundColorattribute (string) - Stores preset slugstyle.color.backgroundattribute - Stores custom color value- Color picker UI in the editor
Text Color
textColorattribute - Preset slugstyle.color.textattribute - Custom value
Gradients
gradientattribute - Preset gradient slugstyle.color.gradientattribute - Custom gradient
Link, Heading, and Button Colors
Available since WordPress 6.5
Real Example: Paragraph Block
Frompackages/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:- 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
Frompackages/block-library/src/group/block.json:
Typography Support
object
Enables font-size, line-height, and other text controls
Font Size
fontSizeattribute - Preset size slugstyle.typography.fontSizeattribute - Custom value
Line Height
style.typography.lineHeightattribute
Text Alignment
Available since WordPress 6.6
Real Example: Button Block
Frompackages/block-library/src/button/block.json:
Border Support
object
Enables border color, radius, style, and width controls
packages/block-library/src/paragraph/block.json:
Dimensions Support
Available since WordPress 6.2
object
Controls for width, height, min-height, and aspect-ratio
Alignment Support
boolean | array
Enable block alignment controls
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 stackingflex- Flexbox layoutconstrained- Centered content with max-width
Real Example: Columns Block
Frompackages/block-library/src/columns/block.json:
Anchor Support
boolean
default:"false"
Allows users to define a custom HTML anchor/ID
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 classCustom 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
Shadow Support
Available since WordPress 6.5
style.shadow attribute.
Background Support
Available since WordPress 6.5
Interactivity API
boolean | object
Indicates Interactivity API compatibility
Combining Multiple Supports
Real-world example from the core Paragraph block:Accessing Support Values
Check if a block supports a feature:Best Practices
Use supports instead of custom attributes
Use supports instead of custom attributes
Leverage block supports for common features rather than implementing custom attributes and controls.
Set default controls
Set default controls
Use
__experimentalDefaultControls to show important controls by default while hiding advanced options.Consider theme compatibility
Consider theme compatibility
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