Remix App Favicon Links: The Developer's Setup Guide
If you've pasted favicon <link> tags directly into app/root.tsx and watched Remix dedupe or silently drop them — the right pattern is the links export. This is where Remix v2 expects HTML link descriptors, and the framework renders them into the document head for you. (See the official Remix route links documentation for the full API surface.)
Prerequisites
You need a working Remix v2 project and a stack of favicon files. For the complete modern set, prepare:
/public/favicon.svg — vector source, supports dark mode
/public/favicon.ico — legacy fallback for older browsers
/public/apple-touch-icon.png — 180×180 for iOS home screen
/public/site.webmanifest — for PWA install behavior
Anything you drop into public/ is served from the site root, so /public/favicon.svg resolves to https://yoursite.com/favicon.svg with no extra routing.
Step 1: Build the links export in root.tsx
The links export is a function returning an array of <link> descriptors. Remix maps each descriptor onto a real HTML tag in the document head. Use LinksFunction from @remix-run/node (or your runtime-specific package) for proper typing.
The rel values map directly onto the HTML spec — see whatwg's rel=icon definition for the full vocabulary. Browsers pick the first icon that matches their current context, so list your crisp SVG before the ICO fallback.
Step 2: Add Apple Touch and manifest entries
Remix treats every descriptor the same way regardless of resource type. Stack them in the same array:
The sizes attribute is informational — browsers consult it when picking the best fit for a given rendering context. For broader favicon link tag patterns beyond the Remix export, see our favicon HTML code examples.
Step 3: Ship dark-mode SVGs cleanly
Browsers do honor media on icon link tags. You can ship two SVGs and let the browser pick the right one based on the user's color scheme. Save a second file as /public/favicon-dark.svg, then add both descriptors:
The HTML spec explicitly supports media descriptors on icon links, so this is a first-class pattern — not a hack. For the SVG-side setup that makes these files swap correctly, our favicon dark mode guide walks through the media query syntax in detail.
Step 4: Cache-bust when you update icons
Browsers cache favicon.ico aggressively, and Remix does not add a content hash to public/ assets by default. Append a version query string when you ship a new design:
Bump the v value on every icon release. Caches tied to URLs will refresh, and your users see the new tab graphic immediately.
Common pitfalls
Watch for these when wiring icons through the Remix links export:
Putting tags in raw JSX. Tags written inside <head> in root.tsx render, but Remix deduplication and SSR ordering can drop them silently. The export is the documented path.
Forgetting type. Without a MIME hint, Safari sometimes picks the wrong format. image/svg+xml and image/x-icon are safe defaults.
Using shortcut icon. This legacy attribute is not part of the HTML spec — modern browsers ignore it. Use alternate icon instead.
Skipping the manifest rel. PWA installs read from site.webmanifest, not from icon links. Reference it from the same links array.
Stale icon after deploy. Browser caches survive deployments. Always cache-bust on icon updates.
Wrapping up
The Remix links export is the cleanest place to wire favicon HTML tags. You get type safety, predictable SSR output, and a single file to edit when you update your icon stack. Pair it with a sharp vector source from Mzu favicondl, ship a cache-bust query, and your Remix app will look professional in every browser tab.
如果你曾经在 app/root.tsx 里直接写 favicon <link> 标签,结果被 Remix 去重甚至悄悄丢掉——正确做法是用 links 导出。Remix v2 期望 HTML link 描述符就放在这里,框架会自动把它们渲染到文档 head 里。完整 API 见官方 Remix route links 文档。
app/root.tsx에 favicon <link> 태그를 그대로 붙여넣었는데 Remix가 중복을 제거하거나 조용히 누락시키는 현상을 보신 적이 있다면, 올바른 패턴은 links export입니다. 이 위치는 Remix v2가 HTML link descriptor를 정의하기를 기대하는 정확한 곳이며, 프레임워크가 이를 자동으로 document head로 렌더링해 줍니다. 전체 API 명세는 공식 Remix route links 문서를 참고해 주세요.
사전 요구사항
작동하는 Remix v2 프로젝트와 favicon 파일 묶음이 필요합니다. 모던 셋업을 모두 구성하려면 다음 파일을 준비하세요.
/public/favicon.svg — 벡터 소스, 다크 모드 지원
/public/favicon.ico — 구형 브라우저용 레거시 폴백
/public/apple-touch-icon.png — iOS 홈 화면용 180×180
/public/site.webmanifest — PWA 설치 동작용
public/에 넣은 모든 파일은 사이트 루트에서 그대로 서빙되므로, /public/favicon.svg는 별도의 라우팅 작업 없이 https://yoursite.com/favicon.svg로 해석됩니다.
Step 1: root.tsx에 links export 구성하기
links export는 <link> descriptor 배열을 돌려주는 함수입니다. Remix는 각 descriptor를 document head의 실제 HTML 태그로 매핑합니다. 타입 안전성을 위해 @remix-run/node(또는 런타임별 패키지)에서 LinksFunction을 import해 사용하세요.
sizes 속성은 정보 제공용이며, 브라우저가 각 렌더링 컨텍스트에 가장 잘 맞는 icon를 고를 때 참고합니다. Remix export를 넘어선 favicon link 태그 패턴은 favicon HTML 코드 예제에서 확인할 수 있습니다.
Step 3: 다크 모드 SVG 깔끔하게 배포하기
브라우저는 icon link 태그의 media 속성도 그대로 인지합니다. 두 개의 SVG를 배포하고 사용자의 color scheme에 따라 브라우저가 알맞은 파일을 선택하도록 할 수 있습니다. 두 번째 파일을 /public/favicon-dark.svg로 저장한 뒤, 두 descriptor를 모두 추가하세요.
HTML 명세는 icon link에서 media descriptor를 명시적으로 지원하므로, 이 패턴은 hack이 아닌 정식 first-class 패턴입니다. 두 SVG가 컬러 스킴에 맞춰 정상적으로 교체되도록 만드는 SVG 측 설정은 favicon 다크 모드 가이드에서 media query 문법을 자세히 다룹니다.
Step 4: icon 업데이트 시 cache-bust 처리하기
브라우저는 favicon.ico를 매우 적극적으로 캐싱하며, Remix는 기본적으로 public/ 자산에 content hash를 붙이지 않습니다. 새 디자인을 배포할 때는 버전 쿼리 스트링을 덧붙이세요.
icon 릴리스마다 v 값을 올려주세요. URL에 묶인 캐시가 갱신되어, 사용자는 새 탭 그래픽을 즉시 보게 됩니다.
자주 발생하는 실수
Remix links export로 icon을 연결할 때는 다음 사항에 주의하세요.
raw JSX에 태그를 직접 넣기.root.tsx의 <head> 안에 작성된 태그는 렌더링되지만, Remix의 dedup 로직과 SSR 순서 때문에 조용히 누락될 수 있습니다. export가 문서화된 정식 경로입니다.
type을 누락하기. MIME 힌트가 없으면 Safari가 가끔 잘못된 형식을 선택합니다. image/svg+xml과 image/x-icon이 안전한 기본값입니다.
shortcut icon 사용하기. 이 레거시 속성은 HTML 명세에 포함되지 않으며, 모던 브라우저는 이를 무시합니다. 대신 alternate icon을 사용하세요.
manifest rel을 빠뜨리기. PWA 설치는 icon link가 아니라 site.webmanifest를 읽습니다. 같은 links 배열에서 함께 참조하세요.
배포 후 icon이 stale 상태로 남기. 브라우저 캐시는 배포 시점과 무관하게 유지됩니다. icon 업데이트 시에는 반드시 cache-bust 처리를 하세요.
마무리
Remix links export는 favicon HTML 태그를 연결하기에 가장 깔끔한 위치입니다. 타입 안전성, 예측 가능한 SSR 출력, 그리고 icon 묶음을 업데이트할 때 단 한 파일만 수정하면 되는 단순함을 모두 얻을 수 있습니다. Mzu favicondl의 선명한 벡터 소스와 결합하고 cache-bust 쿼리를 함께 배포하면, 모든 브라우저 탭에서 완성도 높은 Remix 앱을 보여줄 수 있습니다.
Si has pegado etiquetas <link> de favicon directamente en app/root.tsx y has visto cómo Remix las deduplica o las descarta silenciosamente, el patrón correcto es el export links. Aquí es donde Remix v2 espera los descriptores de enlaces HTML, y el framework los renderiza en el head del documento por ti. (Consulta la documentación oficial de route links en Remix para ver la superficie completa de la API.)
Requisitos previos
Necesitas un proyecto de Remix v2 en funcionamiento y un conjunto de archivos de favicon. Para el set moderno completo, prepara:
/public/favicon.svg — fuente vectorial, soporta modo oscuro
/public/favicon.ico — fallback legacy para navegadores antiguos
/public/apple-touch-icon.png — 180×180 para la pantalla de inicio de iOS
/public/site.webmanifest — para el comportamiento de instalación PWA
Todo lo que coloques en public/ se sirve desde la raíz del sitio, así que /public/favicon.svg se resuelve en https://yoursite.com/favicon.svg sin enrutamiento adicional.
Paso 1: Construye el export links en root.tsx
El export links es una función que devuelve un array de descriptores <link>. Remix mapea cada descriptor a una etiqueta HTML real en el head del documento. Usa LinksFunction desde @remix-run/node (o el paquete específico de tu runtime) para un tipado correcto.
Los valores de rel se mapean directamente a la especificación HTML — consulta la definición de rel=icon del whatwg para ver el vocabulario completo. Los navegadores eligen el primer icono que coincida con su contexto actual, así que lista tu SVG nítido antes del fallback ICO.
Paso 2: Añade las entradas de Apple Touch y manifest
Remix trata cada descriptor de la misma forma independientemente del tipo de recurso. Apílalos en el mismo array:
El atributo sizes es informativo — los navegadores lo consultan al elegir el mejor ajuste para un contexto de renderizado dado. Para patrones más amplios de etiquetas link de favicon más allá del export de Remix, consulta nuestros ejemplos de código HTML para favicon.
Paso 3: Publica SVGs de modo oscuro de forma limpia
Los navegadores sí respetan media en las etiquetas link de iconos. Puedes publicar dos SVGs y dejar que el navegador elija el correcto según el esquema de color del usuario. Guarda un segundo archivo como /public/favicon-dark.svg y luego añade ambos descriptores:
La especificación HTML soporta explícitamente descriptores media en los enlaces de iconos, así que este es un patrón de primera clase — no un hack. Para la configuración del lado del SVG que hace que estos archivos cambien correctamente, nuestra guía de favicon en modo oscuro explica la sintaxis de media query en detalle.
Paso 4: Rompe la caché cuando actualices los iconos
Los navegadores cachean favicon.ico de forma agresiva, y Remix no añade un content hash a los assets de public/ por defecto. Añade una cadena de versión cuando publiques un nuevo diseño:
Incrementa el valor de v en cada release de iconos. Las cachés vinculadas a URLs se refrescarán y tus usuarios verán el nuevo gráfico en la pestaña de inmediato.
Errores comunes
Ten cuidado con esto cuando conectes iconos a través del export links de Remix:
Poner las etiquetas en JSX crudo. Las etiquetas escritas dentro de <head> en root.tsx se renderizan, pero la deduplicación y el orden del SSR en Remix pueden descartarlas silenciosamente. El export es el camino documentado.
Olvidar type. Sin una pista de MIME, Safari a veces elige el formato incorrecto. image/svg+xml y image/x-icon son valores seguros por defecto.
Usar shortcut icon. Este atributo legacy no forma parte de la especificación HTML — los navegadores modernos lo ignoran. Usa alternate icon en su lugar.
Omitir el rel del manifest. Las instalaciones PWA leen desde site.webmanifest, no desde los enlaces de iconos. Haz referencia al mismo array links.
Icono obsoleto tras el deploy. Las cachés del navegador sobreviven a los despliegues. Siempre rompe la caché en actualizaciones de iconos.
Cierre
El export links de Remix es el lugar más limpio para cablear las etiquetas HTML de favicon. Obtienes seguridad de tipos, salida SSR predecible y un único archivo que editar cuando actualices tu stack de iconos. Combínalo con una fuente vectorial nítida de Mzu favicondl, añade una query de cache-busting y tu app Remix lucirá profesional en cada pestaña del navegador.
Need every favicon file in one package?
Generate SVG, ICO, Apple Touch icons, and manifest files in seconds with Mzu favicondl.