I need to render HTML in a Textarea

Hi Team, I have a doubt. Is there any option to render HTML in a Textarea? (or any pro component). We are using vaadin 24.4. Thanks. Regards.

TextArea naturally is not a Wysiwyg editor. For that you need to use RichTextEditor (Pro) or one of the equivalent add-ons in the Directory.

What you can do with TextArea, is that you can write HTML there, but it is shown as HTML. It does not provide any syntax highlight or things that would help to verify HTML correctness.

Vaadin does provide Jsoup dependency and once value change is triggered from TextArea, you can use Jsoup to verify it is correct HTML.

Also what Vaadin has is Html component, that allows to show the HTML fragment you edited, but it wont be shown in TextArea, it is an additional component.

2 Likes