Hello I upgrade my app from 23 to 24 version. Label component seems deprecated. Anyone know which component I should use for replace label ? THX for help
Use NativeLabel instead, if you need the HTML element, which is normally not needed within a Vaadin Flow application’s high-level components.
This Label component / element is not meant for loose text in the page - it should only be coupled with another component by using the setFor(Component) or by adding them to it with the add(Component…) method, for example if you use Input.
In case it’s not a label for a input, you can use Span or Html… (the appropriate html tag can vary depending on the usage in your application
TL;DR: if it’s an actual label for an input field, use NativeLabel
, otherwise use Span
, unless you need rich HTML content in it, in which case use Html
.
And of course for headings there’s classes for H1 to H6.