Setting Favicon Icon
The favicon is the small icon that appears in browser tabs, bookmarks, and other areas. Customizing it helps with brand recognition and gives your web application a professional look.
Changing the Favicon
- Navigate to the
pages
folder in your project - Open the
_app.js
file - Locate the favicon link tag in the file
- Update the path to your custom favicon
Creating a Favicon
If you need to create a favicon:
- Prepare a square image that represents your brand (ideally 16x16, 32x32, or 64x64 pixels)
- Convert it to
.ico
format using an online converter or image editing software - Place the favicon file in your project's public folder
- Update the reference in
_app.js
as shown above
Multiple Favicon Sizes
For better compatibility across devices, you may want to include multiple favicon sizes:
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
Testing Your Favicon
After updating the favicon:
- Save all changes
- Restart your development server
- Open your application in a browser
- Check if the new favicon appears in the browser tab
- Clear your browser cache if the old favicon still appears