Skip to main content
Faviqo

Favicon for Vue

How to add a favicon to a Vue app

Vue apps keep the favicon in the same place as any static site: the public/ folder and the <head> of index.html. Generate the kit below, then follow the steps for Vite, Vue CLI or Nuxt.

Generate my Vue icon kit →Free · no upload · one ZIP

Add the favicon in Vue

Upload files to
public/
Add code to
index.html
  1. Unzip the package into the public/ folder.
  2. Open index.html — in the project root for Vite projects, or public/index.html for Vue CLI.
  3. Replace the existing favicon link with the snippet inside <head>.

index.html

<link rel="icon" href="/favicon.ico" sizes="32x32">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="icon" type="image/png" sizes="48x48" href="/favicon-48x48.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png">
<link rel="manifest" href="/site.webmanifest">
<meta name="theme-color" content="#FFFFFF">

The file names match what the generator produces. Your theme colour and name are filled in when you generate your own kit.

Nuxt: put the files in public/ and add the links under app.head.link in nuxt.config.

Vite, Vue CLI and Nuxt differ

Three toolchains are common in Vue projects and each one keeps the favicon somewhere different. A Vite project has index.html at the root and static files in public/. Vue CLI keeps index.html inside public/ and builds the base path into links with <%= BASE_URL %>. Nuxt has no index.html at all: it builds the head from configuration.

In Vite and Vue CLI you edit the HTML by hand, and the file names from the kit can be used as they are. In Nuxt the same tags are written as objects in nuxt.config, and static files go in public/ so they are served from the root. Nuxt can also set icons per page with useHead, which is useful for a section that needs its own look.

If the app is deployed under a sub-path, set the base option in Vite or publicPath in Vue CLI, and use the base-aware form of the link. A hard-coded /favicon.ico then breaks quietly because it points at the domain root instead of your app.

nuxt.config.ts

export default defineNuxtConfig({
  app: {
    head: {
      link: [
        { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" },
        { rel: "icon", type: "image/x-icon", href: "/favicon.ico" },
        { rel: "apple-touch-icon", href: "/apple-touch-icon-180x180.png" },
        { rel: "manifest", href: "/site.webmanifest" },
      ],
    },
  },
});

For a plain Vite or Vue CLI project paste the equivalent <link> tags into index.html instead. Files go in public/ in all three.

Check it worked

  1. Build the project and look at the generated HTML for the icon links.
  2. Open each icon path in the browser. If one returns the app's HTML instead of an image, the router is catching a path the server does not serve.
  3. Test in a private window with the cache disabled in DevTools.

Why your Vue favicon may not show

  • Vue CLI and Vite put index.html in different places (public/ vs project root). Edit the right one.
  • Nuxt does not use index.html. Add the links under app.head.link in nuxt.config instead of editing HTML.
  • Remove the default favicon.ico from the template, or the old file can still be served.
  • Vite hashes files imported from src/, but files in public/ are copied as-is, which is what you want for favicons.

Already published? Run your site through the favicon checker to see exactly what is wrong, or see every favicon size for what each file is for.

Vue favicon FAQ

Where does the favicon go in a Vue 3 + Vite project?

In public/, with the link tags in the index.html at the project root.

How do I add a favicon in Nuxt?

Put the files in public/ and add the entries to app.head.link in nuxt.config.ts.

Why is my Vue favicon not updating?

Your browser cached the old one. Hard-refresh, test in a private window, and make sure the old link tag is gone.

Skip the resizing.

Drop in one logo and get every size, the manifest and the HTML for Vue.

Open the favicon generator →