Hi, is possible to hide the toolbar?

Hi, is possible to hide the toolbar?

There’s not a Java API for that (yet), but you can do it with CSS. The toolbar has a part=“toolbar” attribute, which means that it can be targeted. With CSS, you can then for example set display:none on it. All the buttons have separate part names so each button can be individually targeted, if you want to remove some of the options.

The themable parts can be found in the HTML API docs under “The following shadow DOM parts are available for styling”. https://vaadin.com/components/vaadin-rich-text-editor/html-api/elements/Vaadin.RichTextEditorElement

The documentation to apply theming to Vaadin apps can be found here. Check the sibling pages. https://vaadin.com/docs/v13/flow/theme/theming-overview.html

As pseudo-code, the way to do it should be something like this:

<dom-module id="my-vaadin-rich-text-editor" theme-for="vaadin-rich-text-editor">
    <template>
        <style>
            [part~="toolbar"]
 {
                display:none;
            }
        </style>
    </template>
</dom-module>

Thanks.
With your suggestions I can hide the RTF toolbar always, applaying the related theme.
But in my situation I need to hide sometimes the toolbar, so the Java API could be a good approach to solve it.
You did a good work. I will wait the upgrade :)
Thnaks

You can apply a class name in front of the part. Something like .hidetoolbar [part~="toolbar"] {.... Then you can do rte.addClassName("hidetoolbar"); to apply the hiding on runtime in Java. Might be that the Css must be in format :host(.hidetoolbar) or similar.