Interface HasViewHeaderTitle
AppNavLayout checks for this
interface on each navigation and places the result in the viewHeaderSlot (desktop only).
The default implementation calls getViewHeaderIcon() and reads PageTitle
from the view class, then appends getViewHeaderSuffix() if non-null.
Override getViewHeaderSuffix() to append a badge or other component
after the title.
-
Method Summary
Modifier and TypeMethodDescriptiondefault com.vaadin.flow.component.icon.IconReturns an icon for the view header, ornullfor no icon.default com.vaadin.flow.component.ComponentReturns a component to append after the title (e.g. a badge or status chip), ornullto omit the suffix slot.default com.vaadin.flow.component.ComponentReturns the component to place in the view header title slot.
-
Method Details
-
getViewHeaderSuffix
default com.vaadin.flow.component.Component getViewHeaderSuffix()Returns a component to append after the title (e.g. a badge or status chip), ornullto omit the suffix slot.Called on every navigation event; return a new instance on each call.
-
getViewHeaderIcon
default com.vaadin.flow.component.icon.Icon getViewHeaderIcon()Returns an icon for the view header, ornullfor no icon.Important:
Iconis a live DOM component; each call to this method must return a new instance. Returning a cachedIconwill cause it to be silently moved out of its current parent on each navigation event. -
getViewHeaderTitle
default com.vaadin.flow.component.Component getViewHeaderTitle()Returns the component to place in the view header title slot.Called on every navigation event. The default implementation composes an icon (from
getViewHeaderIcon()), a heading (fromPageTitle), and an optional suffix (fromgetViewHeaderSuffix()) into a horizontal layout. Override to replace the entire title component. Returnnullto suppress the slot.
-