How to add Link/URL button into remirror toolbar?

Viewed 158

I am using remirror to build WSYWIG editor.

The requirement is to have an "Link" icon in the toolbar, so that when a user selects text and clicks on that icon, then an options appears to add a hyperlink behind it.

I have found the LinkExtension in the docs, but I have difficulties figuring out how to add that to the toolbar.

enter image description here

2 Answers

Not familiar with Remirror, but after taking a quick look at the docs, there seems to be all kinds of ToolbarItem-components ex. ToolbarButtonItem that seem right for this use case.

I have found out that I can add

{ type: ComponentItem.ToolbarButton, onClick: () => alert("figure out how to execute logic"), icon: 'link',  }

but now I am struggling to figure out how to implement the logic

Related