I want to change this icon to something custom. I have established how to create a custom block controls bar, but not sure how to change the icon.
import {BlockControls} from "@wordpress/block-editor";
I want to change this icon to something custom. I have established how to create a custom block controls bar, but not sure how to change the icon.
import {BlockControls} from "@wordpress/block-editor";
1 Answer
Reset to default 2There is a controls prop you can use which is an object. It goes inside. Controls has an icon key which takes a string which corresponds to a Dashicon slug.
<BLockControls
controls={[
icon=”wordpress”
title=__("Test", "gutenberg-examples"),
onClick: () => { doSomething },
isActive: false
]}
/>