You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When displaying content, I (sometimes) want to set it as HTML instead of plain text so that (properly XSS-sanitized) formatting is displayed #2281
Built-in components such as Label could have a setHtml method in addition to the existing setText method. It could be implemented as this.getElement().setProperty("innerHTML", html).
I'm not sure if this should be included in the HasText mixin or if there should be a separate mixin for this purpose.
Activity
Legioth commentedon Jan 3, 2018
There are some additional considerations in vaadin/vaadin-notification-flow#2.
Of particular interest is the special case of components such as
Notificationthat use a<template>for its contents.samie commentedon Mar 5, 2020
Still valid, but is this something to solve by documenting Html element: https://vaadin.com/forum/thread/17423429/setting-element-html-content-directly
People are also trying to use innerHTML now:
https://vaadin.com/forum/thread/17247162
totally-not-ai commentedon Dec 5, 2026
Closing: the
Htmlcomponent supports setting HTML content throughsetHtmlContent, with sanitization.