Package com.vaadin.flow.component.shared
Interface HasPrefix
- All Superinterfaces:
com.vaadin.flow.component.HasElement,Serializable
public interface HasPrefix
extends com.vaadin.flow.component.HasElement
Mixin interface for components that have a prefix slot.
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptiondefault com.vaadin.flow.component.ComponentGets the component in the prefix slot of this field.default voidsetPrefixComponent(com.vaadin.flow.component.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
default void setPrefixComponent(com.vaadin.flow.component.Component component) 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 benullto remove existing prefix component
-
getPrefixComponent
default com.vaadin.flow.component.Component getPrefixComponent()Gets the component in the prefix slot of this field.- Returns:
- the prefix component of this field, or
nullif no prefix component has been set - See Also:
-