richt text elements

default discord avatar
last month

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>




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!


Connect with the Payload Community on Discord



Can't find what you're looking for?

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