markPluginConstructor
As we saw, the RichTextExt can be extended using a plugin system.
For a typical Mark plugin (bold, italic, highlight…), React Bricks provides the markPluginConstructor
helper that allows you to create a new plugin very quickly.
It just accepts a simple MarkPlugin
object:
For the meaning of the arguments, you can see the interface for a RichTextPlugin
.
The icon
is the button’s icon.
Usage example
Here’s the code for React Bricks bold
plugin, created using the markPluginConstructor