Manifest.json React Code

Sources:

  • **
title: ## Contents 
style: nestedList # TOC style (nestedList|inlineFirstLevel)
minLevel: 1 # Include headings from the specified level
maxLevel: 4 # Include headings up to the specified level
includeLinks: true # Make headings clickable
debugInConsole: false # Print debug info in Obsidian console

Overview

Add or generate a manifest.(json|webmanifest) file that matches the Web Manifest Specification in the root of app directory to provide information about your web application for the browser.

Code Snippets

Simple JSON

  • src/components/Example.tsx
// manifest.json or manifest.webmanifest
{
  "name": "My Application",
  "short_name": "App",
  "description": "An application built with React",
  "start_url": "/"
  // ...
}

Generate Manifest

Add a manifest.js or manifest.ts file that returns a Manifest object.

// src/app/manifest.ts
 
import { MetadataRoute } from 'next'
 
export default function manifest(): MetadataRoute.Manifest {
  return {
    name: 'App',
    short_name: 'App',
    description: 'App',
    start_url: '/',
    display: 'standalone',
    background_color: '#fff',
    theme_color: '#fff',
    icons: [
      {
        src: '/favicon.ico',
        sizes: 'any',
        type: 'image/x-icon',
      },
    ],
  }
}

The 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 or see the MDN docs.

See Also


Appendix

Note created on 2024-05-09 and last modified on 2024-05-09.

LIST FROM [[React - Manifest.json]] AND -"CHANGELOG" AND -"04-RESOURCES/Code/React/React - Manifest.json"

(c) No Clocks, LLC | 2024