Nick Diego, a developer advocate at Automattic and core contributor, is the author of the popular Icon Block plugin that enables users to add custom SVG icons and graphics to the WordPress block editor. He is often asked if the plugin can add icons to the core Button block, but that is outside the scope of what it does. Last week he wrote a plugin that fulfills this feature request in a separate plugin without building a custom block.
The Enable Button Icons plugin is available on GitHub as an example that demonstrates how developers can lightly extend core blocks for features like this. Diego said he was inspired by WordPress developer Aki Hamano’s Enable Responsive Image plugin that adds settings to the Image block to elegantly display different images depending on the width of the screen.
Enhancing WordPress Image Blocks with the Enable Button Icons Plugin