mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Internal suggestion to remove `en-US` from Mozilla urls since MDN is available in multiple languages nowadays it will automatically redirect to the viewer’s language preference. Closes [DX-2076](https://linear.app/vercel/issue/DX-2076/make-external-mozilla-links-language-agnostic-in-nextjs-docs)
71 lines
2.0 KiB
Plaintext
71 lines
2.0 KiB
Plaintext
---
|
|
title: manifest.json
|
|
description: API Reference for manifest.json file.
|
|
---
|
|
|
|
Add or generate a `manifest.(json|webmanifest)` file that matches the [Web Manifest Specification](https://developer.mozilla.org/docs/Web/Manifest) in the **root** of `app` directory to provide information about your web application for the browser.
|
|
|
|
## Static Manifest file
|
|
|
|
```json filename="app/manifest.json | app/manifest.webmanifest"
|
|
{
|
|
"name": "My Next.js Application",
|
|
"short_name": "Next.js App",
|
|
"description": "An application built with Next.js",
|
|
"start_url": "/"
|
|
// ...
|
|
}
|
|
```
|
|
|
|
## Generate a Manifest file
|
|
|
|
Add a `manifest.js` or `manifest.ts` file that returns a [`Manifest` object](#manifest-object).
|
|
|
|
```ts filename="app/manifest.ts" switcher
|
|
import { MetadataRoute } from 'next'
|
|
|
|
export default function manifest(): MetadataRoute.Manifest {
|
|
return {
|
|
name: 'Next.js App',
|
|
short_name: 'Next.js App',
|
|
description: 'Next.js App',
|
|
start_url: '/',
|
|
display: 'standalone',
|
|
background_color: '#fff',
|
|
theme_color: '#fff',
|
|
icons: [
|
|
{
|
|
src: '/favicon.ico',
|
|
sizes: 'any',
|
|
type: 'image/x-icon',
|
|
},
|
|
],
|
|
}
|
|
}
|
|
```
|
|
|
|
```js filename="app/manifest.js" switcher
|
|
export default function manifest() {
|
|
return {
|
|
name: 'Next.js App',
|
|
short_name: 'Next.js App',
|
|
description: 'Next.js App',
|
|
start_url: '/',
|
|
display: 'standalone',
|
|
background_color: '#fff',
|
|
theme_color: '#fff',
|
|
icons: [
|
|
{
|
|
src: '/favicon.ico',
|
|
sizes: 'any',
|
|
type: 'image/x-icon',
|
|
},
|
|
],
|
|
}
|
|
}
|
|
```
|
|
|
|
### Manifest Object
|
|
|
|
The manifest object contains an extensive list of options that may be updated due to new web standards. For information on all the current options, refer to the `MetadataRoute.Manifest` type in your code editor if using [TypeScript](https://nextjs.org/docs/app/building-your-application/configuring/typescript#typescript-plugin) or see the [MDN](https://developer.mozilla.org/docs/Web/Manifest) docs.
|