PWA Web App Manifest
When the @PWA
annotation is found, Vaadin automatically generates a web app
manifest file, named manifest.webmanifest
.
Here is a list of properties in the file that you can customize. With the exception of scope
, all properties can be set in the @PWA
annotation.
-
name
: The name of the application. Set this property in thename
parameter in the@PWA
annotation. -
short_name
: The short name of the application. This should not exceed 12 characters. It is used on the device home screen, where there is a limited amount of space. Set this property in theshortName
parameter in the@PWA
annotation. -
description
: The description of the application. The default value is an empty string. Set this property in thedescription
parameter in the@PWA
annotation. -
display
: Defines the preferred display mode for the application. The default value isstandalone
. Set this property in thedisplay
parameter in the@PWA
annotation. -
background_color
: The background color of the application. The default value is#f2f2f2
(gray). Set this property in thebackgroundColor
parameter in the@PWA
annotation. -
theme_color
: The theme color of application. The default value is#ffffff
(white). Set this property in thebackgroundColor
parameter in the@PWA
annotation. -
scope
: Defines the navigation scope of the website’s context. This restricts the web pages that can be viewed while the manifest is applied. The value is set to the context path of application. You cannot change this property in the@PWA
annotation. -
start_url
: The start URL that is navigated to when the application is launched from the installed app (home screen). The default value is an empty string""
that points to the default route target for the application (marked with@Route("")
). Set this property in thestartPath
parameter in the@PWA
annotation. -
icons
: Automatically created from icon resources.
Note
| For more information about these properties, see Web App Manifest in the MDN web docs. |
Renaming the Manifest
You can change the default name (manifest.webmanifest
) of the web app manifest, using the manifestPath
parameter in the @PWA
annotation.
Example: Setting the manifestPath
parameter in the @PWA
annotation.
@PWA(name = "My Progressive Web Application",
shortName = "MyPWA",
manifestPath = "manifest.json")
Overriding the Generated Manifest
You can override the generated manifest file with a custom manifest.
To override the generated web app manifest file:
-
Create a custom manifest file and name it to match the file name set in the
manifestPath
parameter in the@PWA
annotation, for examplemanifest.webmanifest
. -
Add the file to your
src/main/webapp/
folder.
613A416E-3EB8-4049-8A51-B1490A3A1A02