Interface HasLabel

All Superinterfaces:
HasElement, Serializable

public interface HasLabel extends HasElement
A component that supports label definition.

The default implementations set the label of the component to the given text for HasElement.getElement(). Override all methods in this interface if the text should be added to some other element.

Since:
Author:
Vaadin Ltd
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Gets the label of the component.
    default void
    Set the label of the component to the given text.

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement
  • Method Details

    • setLabel

      default void setLabel(String label)
      Set the label of the component to the given text.
      Parameters:
      label - the label text to set or null to clear
    • getLabel

      default String getLabel()
      Gets the label of the component.
      Returns:
      the label of the component or null if no label has been set