Package com.vaadin.flow.component.shared
Interface HasPrefix
- All Superinterfaces:
HasElement
,Serializable
- All Known Subinterfaces:
HasPrefixAndSuffix
- All Known Implementing Classes:
AbstractNumberField
,BigDecimalField
,Button
,ComboBox
,DatePicker
,DrawerToggle
,EmailField
,IntegerField
,NumberField
,PasswordField
,Select
,SideNavItem
,TabSheet
,TextArea
,TextField
,TextFieldBase
,TimePicker
Mixin interface for components that have a prefix slot.
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptiondefault Component
Gets the component in the prefix slot of this field.default void
setPrefixComponent
(Component component) Adds the given component into this field before the content, replacing any existing prefix component.Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
Method Details
-
setPrefixComponent
Adds the given component into this field before the content, replacing any existing prefix component.This is most commonly used to add a simple icon or static text into the field.
- Parameters:
component
- the component to set, can benull
to remove existing prefix component
-
getPrefixComponent
Gets the component in the prefix slot of this field.- Returns:
- the prefix component of this field, or
null
if no prefix component has been set - See Also:
-