blockPluginConstructor
As we saw, the RichTextExt can be extended using a plugin system.
For a typical Block or List plugin (heading, quote, unordered list…), React Bricks provides the blockPluginConstructor
helper that allows you to create a new plugin very quickly.
It just accepts a simple BlockPlugin
object:
For the meaning of the arguments, you can see the interface for a RichTextPlugin
.
The icon
is the button’s icon. If you set an itemName
React Bricks will create a List plugin, otherwise a Block one.
Usage example
Here’s the code for React Bricks h1
plugin, created using the blockPluginConstructor