最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to change Block Controls Icon in Gutenberg?

programmeradmin0浏览0评论

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";

Share Improve this question asked Mar 10, 2020 at 17:50 navxionavxio 337 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

There 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

    
    ]}
/>
发布评论

评论列表(0)

  1. 暂无评论