Insert an SVG icon.
- Name:
core/icon - Category: media
- API Version: 3
- Block Type: Dynamic (server-rendered)
- Keywords:
icon,svg
Attributes
Defined via the attributes property in block.json.
| Attribute | Type | Default | Description |
|---|---|---|---|
icon |
string |
— | Role: content |
flipHorizontal |
boolean |
false |
— |
flipVertical |
boolean |
false |
— |
rotation |
number |
0 |
— |
Supports
Defined via the supports property in block.json.
anchor:trueariaLabel:truealign:"left","center","right"html:falsecolor:background:truetext:true
interactivity:clientNavigation:true
spacing:padding:truemargin:true
dimensions:width:true
CSS Selectors
Defined via the selectors property in block.json.
- root:
.wp-block-icon svg - css:
.wp-block-icon - spacing:
- margin:
.wp-block-icon
- margin:
Block Markup
This is a dynamic block. It is rendered on the server and does not save HTML in post content.
In post content, it is stored as a block comment:
<!-- wp:icon /-->
Source
- block.json (reference)
- Source directory — browse
edit.js,save.js,index.php, and more.