Next.js Apple Icon Setup: The 2026 App Router Guide
If you've ever opened your Next.js site on an iPhone and seen a blank gray square when adding it to the home screen, you're missing the Apple touch icon. The browser tab favicon might look fine, but iOS uses a separate file — and Next.js has a specific way to serve it.
This guide walks through the nextjs apple icon setup using the App Router's file-based metadata system. No custom API routes, no manual <link> tags in _document.tsx — just drop a file in the right folder and you're done.
Prerequisites
Before we start, make sure you have:
A Next.js project using the App Router (version 13.2 or later).
An image file for your icon. Apple recommends a 180×180 PNG for the touch icon, but we'll cover that in a moment.
Basic familiarity with your project's app/ directory.
Step 1: Prepare the Apple Touch Icon
Apple's touch icon is a PNG file that iOS uses when a user adds your site to the home screen. The recommended size is 180×180 pixels, but you can also provide a 167×167 for iPad Pro and 152×152 for older iPads. However, iOS will automatically scale down a 180×180 icon, so you only need one file.
If you don't have a ready icon, you can generate one from your logo using a tool like Mzu favicondl. It can export a 180×180 PNG with the correct transparency and padding.
Step 2: Place the File in the App Directory
In Next.js App Router, you can add apple-icon.png (or apple-icon.jpg) directly in your app/ directory. Next.js automatically detects it and serves it at the root of your site. The file should be placed in the same folder as your layout.tsx — typically app/.
That's it. Next.js will automatically generate the appropriate <link rel='apple-touch-icon'> tag in the head of your pages. You don't need to write any HTML manually.
Step 3: Verify the Generated HTML
To confirm the icon is being served, run your dev server and inspect the page source. You should see a line like this:
If you don't see it, check that the file is named exactly apple-icon.png and is in the correct directory. Next.js is case-sensitive on Linux and macOS.
Step 4: Using the Metadata API for More Control
If you need to specify multiple icons or want to set them programmatically, you can use the metadata export in your layout. This is useful if you have different icons for different routes or want to add a maskable icon for Android.
This approach gives you full control over the rel, sizes, and type attributes. You can also use it to add a maskable icon for Android PWAs, though that's a separate topic.
Common Pitfalls
Here are a few issues you might run into:
File not found: Double-check the filename. It must be apple-icon.png or apple-icon.jpg. Next.js won't pick up apple-touch-icon.png.
Cache issues: iOS caches icons aggressively. If you've changed the icon and don't see the update, try clearing Safari's cache or using a different device.
Wrong size: Apple recommends 180×180, but if you use a different size, iOS will scale it. Scaling can cause blurriness, so stick to the recommended size.
Transparency: iOS does not support transparency in Apple touch icons. If your PNG has transparent areas, they'll appear black. Make sure your icon has a solid background.
Conclusion
Setting up the Apple touch icon in Next.js is straightforward once you know the file-based convention. Drop a properly sized PNG in your app/ folder, and Next.js handles the rest. For more advanced scenarios, the metadata API gives you programmatic control.
If you need to generate the icon itself, try Mzu favicondl to create all the required sizes from your logo. And for a broader look at favicon setup in Next.js, check out our Next.js Favicon guide.
iPhone에서 Next.js 사이트를 홈 화면에 추가했을 때 빈 회색 사각형이 표시된 적이 있다면, Apple 터치 아이콘이 누락된 것입니다. 브라우저 탭의 파비콘은 정상적으로 보일 수 있지만, iOS는 별도의 파일을 사용하며 Next.js는 이를 제공하는 특정한 방법이 있습니다.
이 가이드에서는 App Router의 파일 기반 메타데이터 시스템을 사용한 Next.js Apple 아이콘 설정 방법을 안내합니다. 사용자 정의 API 라우트나 _document.tsx에 수동으로 <link> 태그를 작성할 필요 없이, 올바른 폴더에 파일을 넣기만 하면 됩니다.
사전 요구 사항
시작하기 전에 다음이 준비되어 있는지 확인하세요:
App Router를 사용하는 Next.js 프로젝트(버전 13.2 이상).
아이콘용 이미지 파일. Apple은 터치 아이콘에 180×180 PNG를 권장하지만, 잠시 후에 자세히 다루겠습니다.
프로젝트의 app/ 디렉토리에 대한 기본적인 이해.
1단계: Apple 터치 아이콘 준비
Apple 터치 아이콘은 사용자가 사이트를 홈 화면에 추가할 때 iOS가 사용하는 PNG 파일입니다. 권장 크기는 180×180 픽셀이며, iPad Pro용 167×167, 구형 iPad용 152×152도 제공할 수 있습니다. 그러나 iOS는 180×180 아이콘을 자동으로 축소하므로 하나의 파일만 있으면 됩니다.
준비된 아이콘이 없다면 Mzu favicondl과 같은 도구를 사용하여 로고에서 생성할 수 있습니다. 올바른 투명도와 패딩이 적용된 180×180 PNG를 내보낼 수 있습니다.
2단계: App 디렉토리에 파일 배치
Next.js App Router에서는 apple-icon.png(또는 apple-icon.jpg)를 app/ 디렉토리에 직접 추가할 수 있습니다. Next.js는 이를 자동으로 감지하여 사이트 루트에서 제공합니다. 파일은 layout.tsx와 같은 폴더(일반적으로 app/)에 배치해야 합니다.
이 방법을 사용하면 rel, sizes, type 속성을 완전히 제어할 수 있습니다. 또한 Android PWA용 maskable 아이콘을 추가하는 데 사용할 수도 있지만, 이는 별도의 주제입니다.
일반적인 문제
다음은 발생할 수 있는 몇 가지 문제입니다:
파일을 찾을 수 없음: 파일 이름을 다시 확인하세요. apple-icon.png 또는 apple-icon.jpg여야 합니다. Next.js는 apple-touch-icon.png를 인식하지 못합니다.
캐시 문제: iOS는 아이콘을 적극적으로 캐시합니다. 아이콘을 변경했는데 업데이트가 보이지 않으면 Safari의 캐시를 지우거나 다른 기기를 사용해 보세요.
잘못된 크기: Apple은 180×180을 권장하지만, 다른 크기를 사용하면 iOS가 크기를 조정합니다. 크기 조정은 흐림을 유발할 수 있으므로 권장 크기를 사용하는 것이 좋습니다.
투명도: iOS는 Apple 터치 아이콘에서 투명도를 지원하지 않습니다. PNG에 투명한 영역이 있으면 검은색으로 표시됩니다. 아이콘의 배경이 불투명한지 확인하세요.
결론
Next.js에서 Apple 터치 아이콘을 설정하는 것은 파일 기반 규칙을 알면 간단합니다. 적절한 크기의 PNG를 app/ 폴더에 넣으면 Next.js가 나머지를 처리합니다. 더 고급 시나리오의 경우 metadata API를 통해 프로그래밍 방식으로 제어할 수 있습니다.
Si alguna vez has abierto tu sitio Next.js en un iPhone y has visto un cuadrado gris en blanco al añadirlo a la pantalla de inicio, te falta el icono táctil de Apple. El favicon de la pestaña del navegador puede verse bien, pero iOS usa un archivo separado, y Next.js tiene una forma específica de servirlo.
Esta guía explica la configuración del icono de Apple en Next.js usando el sistema de metadatos basado en archivos del App Router. Sin rutas API personalizadas, sin etiquetas <link> manuales en _document.tsx — solo coloca un archivo en la carpeta correcta y listo.
Requisitos previos
Antes de empezar, asegúrate de tener:
Un proyecto Next.js que use el App Router (versión 13.2 o posterior).
Un archivo de imagen para tu icono. Apple recomienda un PNG de 180×180 para el icono táctil, pero hablaremos de eso en un momento.
Familiaridad básica con el directorio app/ de tu proyecto.
Paso 1: Prepara el icono táctil de Apple
El icono táctil de Apple es un archivo PNG que iOS usa cuando un usuario añade tu sitio a la pantalla de inicio. El tamaño recomendado es de 180×180 píxeles, pero también puedes proporcionar uno de 167×167 para iPad Pro y 152×152 para iPads más antiguos. Sin embargo, iOS escalará automáticamente un icono de 180×180, así que solo necesitas un archivo.
Si no tienes un icono listo, puedes generar uno a partir de tu logo usando una herramienta como Mzu favicondl. Puede exportar un PNG de 180×180 con la transparencia y el relleno correctos.
Paso 2: Coloca el archivo en el directorio app
En el App Router de Next.js, puedes añadir apple-icon.png (o apple-icon.jpg) directamente en tu directorio app/. Next.js lo detecta automáticamente y lo sirve en la raíz de tu sitio. El archivo debe colocarse en la misma carpeta que tu layout.tsx — típicamente app/.
Eso es todo. Next.js generará automáticamente la etiqueta <link rel='apple-touch-icon'> adecuada en el head de tus páginas. No necesitas escribir ningún HTML manualmente.
Paso 3: Verifica el HTML generado
Para confirmar que el icono se está sirviendo, ejecuta tu servidor de desarrollo e inspecciona el código fuente de la página. Deberías ver una línea como esta:
Si no la ves, verifica que el archivo se llame exactamente apple-icon.png y que esté en el directorio correcto. Next.js distingue entre mayúsculas y minúsculas en Linux y macOS.
Paso 4: Usa la API de metadatos para más control
Si necesitas especificar varios iconos o quieres configurarlos programáticamente, puedes usar la exportación metadata en tu layout. Esto es útil si tienes diferentes iconos para diferentes rutas o quieres añadir un icono maskable para Android.
Este enfoque te da control total sobre los atributos rel, sizes y type. También puedes usarlo para añadir un icono maskable para PWAs de Android, aunque eso es un tema aparte.
Errores comunes
Aquí tienes algunos problemas con los que podrías encontrarte:
Archivo no encontrado: Verifica el nombre del archivo. Debe ser apple-icon.png o apple-icon.jpg. Next.js no reconocerá apple-touch-icon.png.
Problemas de caché: iOS almacena en caché los iconos de forma agresiva. Si has cambiado el icono y no ves la actualización, intenta limpiar la caché de Safari o usa otro dispositivo.
Tamaño incorrecto: Apple recomienda 180×180, pero si usas un tamaño diferente, iOS lo escalará. El escalado puede causar borrosidad, así que sigue el tamaño recomendado.
Transparencia: iOS no admite transparencia en los iconos táctiles de Apple. Si tu PNG tiene áreas transparentes, aparecerán en negro. Asegúrate de que tu icono tenga un fondo sólido.
Conclusión
Configurar el icono táctil de Apple en Next.js es sencillo una vez que conoces la convención basada en archivos. Coloca un PNG del tamaño adecuado en tu carpeta app/, y Next.js se encarga del resto. Para escenarios más avanzados, la API de metadatos te da control programático.
Si necesitas generar el icono en sí, prueba Mzu favicondl para crear todos los tamaños requeridos a partir de tu logo. Y para una visión más amplia de la configuración de favicons en Next.js, consulta nuestra guía de favicons de Next.js.