Course contentsShow
← Web Development
Lesson 2299 of 2,98242. Progressive Web AppsFree lesson

Icons and Splash Screens

Specifying icon sizes, formats, and purposes for different platforms and contexts.

Icons and Splash Screens

You'll learn how to specify icon sizes, formats, and purposes so your PWA looks sharp on every device and context.

Why Multiple Icons Matter

Just as you wouldn't wear the same outfit to a wedding and a beach party, your PWA needs different icons for different contexts. When users install your app, platforms display it in various places: home screens, app launchers, task switchers, splash screens, and more. Each context demands specific dimensions and sometimes specific formats.

The icons Array in Your Manifest

Inside your web app manifest, the icons property is an array of icon objects. Each object describes one image file:

"icons": [
  {
    "src": "/icons/icon-192.png",
    "sizes": "192x192",
    "type": "image/png"
  },
  {
    "src": "/icons/icon-512.png",
    "sizes": "512x512",
    "type": "image/png",
    "purpose": "any maskable"
  }
]

Essential Properties

  • src: Path to the icon file
  • sizes: Dimensions in pixels (e.g., "192x192" or "48x48 96x96" for multi-size)
  • type: MIME type (usually image/png or image/webp)
  • purpose: How the icon should be used

Understanding purpose

  • any (default): Standard icon, may be padded or cropped
  • maskable: Designed with a safe zone; platforms can apply masks (circles, rounded squares)
  • any maskable: Works as both (space-separated)

Common Sizes to Provide

At minimum, provide 192×192 and 512×512 PNG icons. Android uses these for home screen and splash screens. Consider adding 144×144, 180×180, and others for broader compatibility.

Key Takeaway: Provide multiple icon sizes and formats in your manifest's icons array, using purpose: "maskable" for adaptive icons, so your PWA looks native across all platforms and contexts.