Allow programmatic control for Rich Text Editor buttons

I’d like to disallow certain buttons in the Rich Text Editor, for applications that don’t support certain content. For example, I have an application where images & code blocks are not supported.

It’d be nice to do this in code, with something like:

rich_text_editor.disableButton('image')
rich_text_editor.enableButton('image')

Currently it’s possible to hide them through CSS, either globally or through a text node with tags. Something like this works:

.texteditor-container .ql-toolbar .ql-code-block { display: none; }
.texteditor-container .ql-toolbar .ql-image { display: none; }
6 Likes

This would be really great. Another feature would be to add your own custom buttons with custom commands. Currently, I use the rich text editor as a blog post editor, which sometimes has a video in it, but there is no button that allows you to add a video. It'd be great if we could add our own buttons, and have them allow us to add our own specified HTML such as a <video> tag. It would be great to overall have more control over the rich text editor.

Thanks for this feedback & specific use cases! This isn't on our current roadmap, but I'll submit a feature request. I'll post on this thread if it gets picked up :slightly_smiling_face: