com.vaadin.flow.theme.
Annotation Interface Theme
Defines the theme to use for the application. Should be present only once for an app, in the `AppShellConfiguration` class.
The value
property defines the name of the application theme. When
the theme is present inside the project, it maps to the
frontend/themes/<application-theme-name>
/ folder or alternatively to a
folder inside the static resources of a jar file, like
src/main/resources/META-INF/resources/themes/<application-theme-name>/
. The application theme is always based on Lumo theme and this is the
recommended way to theme applications starting from Flow 6.0 and Vaadin 19.
Alternatively , if instead of Lumo theme the Material theme or another "old
style custom theme" is to be used, that can be specified with the
themeClass
property. This allows defining a way to translate base component
url to the themed component url (@see AbstractTheme
), which specifies
components styles.
By default com.vaadin.flow.theme.lumo.Lumo
theme is used if it's in
the classpath. You may disable theming with NoTheme
annotation.
Theme
annotation should be added to the AppShellConfigurator
implementation.
Only a single theme can be defined and having multiple instances will throw an exception.
Here is some examples:
@Theme("my-theme")
public class MyAppShell implements AppShellConfigurator {
}
@Theme(themeClass = Lumo.class)
public class MyAppShell implements AppShellConfigurator {
}
Since:
1.0
Author:
Vaadin Ltd
See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<? extends AbstractTheme>
The theme translation handler.
The name of the theme to use.
The theme variant, if any.
-
Element Details
-
themeClass
Class<? extends AbstractTheme> themeClassThe theme translation handler. Defaults to Lumo, If not specified.
Returns:
theme handler
Default:
com.vaadin.flow.theme.AbstractTheme.class
-
variant
String variantThe theme variant, if any.
Returns:
the theme variant
Default:
""
-
value
String valueThe name of the theme to use. If this is not specified will default to Lumo.
Default:
""
-