What is a Web App Manifest?

A critical aspect of Progressive Web Apps (PWAs) is their ability to provide an app-like experience on mobile and desktop devices.

One key component that enables this behavior is the Web App Manifest—a JSON file that defines how the PWA appears and behaves when installed on a user’s device.

Defining the Web App Manifest

The Web App Manifest is a simple JSON file that provides metadata about a web application. It allows a PWA to be installed on a device and defines how it should appear in the app launcher or home screen.

The manifest file typically includes the following properties:

A basic Web App Manifest looks like this:

{
  "name": "Rails PWA",
  "short_name": "PWA",
  "start_url": "/",
  "display": "standalone",
  "background_color": "#ffffff",
  "theme_color": "#ff5722",
  "icons": [
    {
      "src": "/assets/icons/icon-192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "/assets/icons/icon-512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    }
  ]
}

How the Manifest Enhances PWAs

By defining this manifest, the PWA can: