Docs

Documentation versions (currently viewingVaadin 14)

You are viewing documentation for an older Vaadin version. View latest documentation

Creating PWAs with Vaadin

The Vaadin server automatically serves the needed resources for a PWA, when you use the @PWA annotation in the root layout of your application.

Example: Using the @PWA annotation with the @Route annotation to automatically serve PWA resources.

@PWA(name = "My Progressive Web Application",
     shortName = "MyPWA")
@Route("")
public class MyPWA extends Div {
    public MyPWA() {
        setText("Welcome to my PWA");
    }
}
Note
You can only have one @PWA annotation per application. The annotation must be placed in the application’s parent layout, or in a view annotated with @Route.

A9C32973-4754-4F10-998F-FB4E64E1093B