Package com.vaadin.flow.component
Interface HasLabel
- All Superinterfaces:
HasElement
,Serializable
- All Known Subinterfaces:
InputField<E,
V>
- All Known Implementing Classes:
AbstractNumberField
,BigDecimalField
,Checkbox
,CheckboxGroup
,ComboBox
,ComboBoxBase
,CustomField
,DatePicker
,DateTimePicker
,EmailField
,IntegerField
,MultiSelectComboBox
,NumberField
,PasswordField
,RadioButtonGroup
,Select
,Tab
,TextArea
,TextField
,TextFieldBase
,TimePicker
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.
Root element should be a web component with a structure that supports the 'label' property:
<field-with-label>
<shadow-root>
<input type="checkbox" id="input"/>
<label for="input">${label}</label>
</shadow-root>
</field-with-label>
- Since:
- Author:
- Vaadin Ltd
-
Method Summary
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
Method Details
-
setLabel
Set the label of the component to the given text.- Parameters:
label
- the label text to set ornull
to clear
-
getLabel
Gets the label of the component.- Returns:
- the label of the component or
null
if no label has been set
-