richt text elements

default discord avatar
Raoul
last month
2

Has someone made a custom codeblock element to the rich text editor?



I wanted to trigger a leaf while adding the type and ended up with this



const ToolbarButton: React.FC<{ path: string }> = () => {


return (


<ElementButton format="code-block">


<LeafButton format="code">Code</LeafButton>


</ElementButton>


);


};



export default ToolbarButton;



wonder if this is a good practice solution at all.

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.