site.webmanifest
The site.webmanifest file defines how your web application behaves when installed on a device. It supplies metadata—such as names, icons, colors, and display modes—to modern browsers and helps deliver a native-like experience on mobile and desktop.
Purpose
This manifest enables Progressive Web App (PWA) features by:
- Specifying app names and icons
- Customizing splash screens and browser UI
- Controlling how the app launches (standalone, fullscreen, etc.)
File Content
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
Key Fields
name
A full app name displayed in install prompts and settings.
Keep this descriptive and user-friendly.
short_name
An abbreviated name used where space is limited (e.g., home screen labels).
Use a concise string (≤ 12 characters) for clarity.
icons 📱
An array of icon definitions for different contexts.
Browsers select the best match from sizes and type.
| src | sizes | type |
|---|---|---|
| /android-chrome-192x192.png | 192x192 | image/png |
| /android-chrome-512x512.png | 512x512 | image/png |
theme_color 🎨
Defines the browser toolbar color when the app is launched.
Use a hex value that matches your brand palette.
background_color 🖼️
Sets the splash screen background color before the app renders.
Ensure good contrast with your logo or loading indicator.
display
Controls the app’s display mode. Common values:
standalone: Hides browser UI, shows own app framefullscreen: Fullscreen without any browser controlsminimal-ui: Shows minimal browser UI (back, reload)browser: Default mode (full browser UI)
Usage Integration
To activate this manifest, include the following in your HTML’s <head>:
<link rel="manifest" href="/site.webmanifest">
<meta name="theme-color" content="#ffffff">
- Browsers fetch
site.webmanifestand apply settings. - Service workers and HTTPS are required for full PWA support.
Best Practices
- Always fill
nameandshort_namefor clear identification. - Provide icons in multiple sizes (e.g., 192×192, 512×512).
- Choose accessible colors for
theme_colorandbackground_color. - Test installation on Android, iOS, and desktop for consistency.
- Version your manifest or update its
hrefto force cache refresh.
🎉 With this configuration, your web app can be “installed” like a native app, offering users a seamless experience across devices.