Skip to content

How to Add favicon.ico on Next.js 13 & Next.js 14 #50704

Answered by devjiwonchoi
clevermiraz asked this question in Help
Discussion options

You must be logged in to vote

Edit

Everyone is getting confused, let me make this simple.

Convention

Place favicon.ico inside the app/ or public/ folder, which Next.js will auto-generate the necessary metadata.

.
├── app/
│   └── favicon.ico <-- here OR
└── public/
    └── favicon.ico <-- here

Else

Place the favicon file(s) on the public, then use Metadata or generateMedatada.

export const metadata = {
  icons: {
    icon: '/icon.png', // /public path
  },
}

You can also change favicon by color scheme:

icons: {
  icon: [
    {
      url: '/light-icon.png',
      media: '(prefers-color-scheme: light)',
    },
    {
      url: '/dark-icon.png',
      media: '(prefers-color-scheme: dark)',
    },
  ],
},

Reference

Replies: 9 comments 48 replies

Comment options

You must be logged in to vote
24 replies
@Marius9595
Comment options

@StackOverflowIsBetterThanAnyAI
@charlie763
Comment options

@atlamors
Comment options

@victornasar
Comment options

Answer selected by clevermiraz
Comment options

You must be logged in to vote
3 replies
@ChristophHandschuh
Comment options

@amitsuthar69
Comment options

@viktoriabakun
Comment options

Comment options

You must be logged in to vote
1 reply
@clevermiraz
Comment options

Comment options

You must be logged in to vote
11 replies
@ileys-admin
Comment options

@narutophuc113
Comment options

@CarlosSousa2001
Comment options

@Wellington-Matoss
Comment options

@Vdcds
Comment options

Comment options

You must be logged in to vote
3 replies
@ChrisHPZ
Comment options

@ddkeating
Comment options

@ShahAashka
Comment options

Comment options

You must be logged in to vote
2 replies
@didiamuri
Comment options

@jeevanlogiciel
Comment options

Comment options

You must be logged in to vote
4 replies
@Cnerd-Mahadi
Comment options

@NicollasMelo
Comment options

@ParvinEyvazov
Comment options

@devjiwonchoi
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet