0

I'm looking any solutions how to add custom button to top toolbar in Gutenberg editor. I want to add button like "Design Library" in Kadence Blocks plugin. As far as I know there is no official way for that, but Kadence did it somehow.

enter image description here

Any advice?

1 Answer 1

1

Here’s how Kadence does it. I'd avoid hacks like that if possible but I'm not sure what your requirements are.

Some alternative ideas (not mutually exclusive):

  • Use plugin sidebar
  • Add a command to do whatever the button would
  • Add a keyboard shortcut to do whatever the button would

On that third item I don't know of a good documentation example of how to do it but here’s the relevant parts in core of how it's done for the Keyboard Shortcut Help modal. It's a two-step of registerShortcut/useShortcut.

1
  • Thanks! I'll look into this!
    – D_P
    Commented Aug 16, 2023 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.