To replace an Astro theme logo, find the logo component (usually src/components/Logo.astro or inline SVG in the header), swap in your own SVG, and keep the same width and height props so the header layout doesn’t shift. For the favicon, replace the files in public/ (favicon.svg, plus a PNG fallback and an Apple touch icon) and check that the base layout’s <link rel="icon"> tags point at them.
Key Takeaways
- Search for the demo logo in both
src/andpublic/; themes often use it in two or three places.- Import your SVG as a component in Astro 7 so it inherits
currentColorand scales cleanly.- Ship
favicon.svgplus a 180×180apple-touch-icon.png; that covers modern browsers and iOS.- Don’t forget the default social share image, which usually still shows the demo brand.
Find every copy of the demo logo
# Terminal: run from the theme root
grep -rln "logo" src --include=*.astro
ls public | grep -iE "logo|favicon|icon|og"
Expect hits in the header, the footer, and sometimes a mobile menu. Some themes import one Logo.astro everywhere, which makes this a one-file job. If you see the same SVG pasted into several components, consolidate it into one component first. The folder structure docs explain what lives in src/ versus public/.
Swap the logo
Save your logo as src/assets/logo.svg. Astro 7 lets you import an SVG file as a component, which renders it inline:
---
// src/components/Logo.astro
import LogoMark from '../assets/logo.svg';
---
<a href="/" class="inline-flex items-center gap-2 text-brand" aria-label="Northline home">
<LogoMark width={32} height={32} aria-hidden="true" />
<span class="text-lg font-semibold">Northline</span>
</a>
Inline SVG inherits color from CSS if the paths use fill="currentColor", so the same file works in light and dark mode. Open the SVG in an editor and replace fixed fills with currentColor where you want that behavior.
For a raster logo (PNG or WebP), use the <Image /> component so Astro sizes and optimizes it:
---
// src/components/Logo.astro
import { Image } from 'astro:assets';
import logo from '../assets/logo.png';
---
<a href="/"><Image src={logo} alt="Northline" width={140} /></a>
Keep the rendered size close to the demo logo’s, or the header may wrap on small screens.
Replace the favicon
Put the new files in public/ so they’re served at the root:
public/
favicon.svg vector icon for modern browsers
favicon-32.png fallback for browsers without SVG icon support
apple-touch-icon.png 180×180, used by iOS home screens
Then make sure the base layout references them:
---
// src/layouts/BaseLayout.astro
---
<head>
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32.png" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
</head>
Browsers cache favicons hard. If the old one still shows, open the icon URL directly or use a private window. The favicon tip covers sizes and the web manifest, and the dark mode SVG favicon tip shows how to make one icon adapt to the browser theme.
Update the social share image
Most themes ship a default Open Graph image such as public/og-default.png with the demo brand on it. Replace it with a 1200×630 image of your own, and grep for og:image to confirm which file the layout uses. If you’d rather generate one per page, see OG image generation in Astro.
Every Komal Astro theme keeps the logo in a single component, so the swap above is usually two files. Astro’s SVG component docs list the props an imported SVG accepts.
FAQ
Where is the logo in an Astro theme?
Usually in src/components/ as Logo.astro or inside Header.astro, with image files in src/assets/ or public/. Search the project for “logo” to find every reference.
What size should an Astro favicon be?
Use an SVG favicon for modern browsers, a 32×32 PNG fallback, and a 180×180 Apple touch icon. Put all three in public/ and reference them from the layout’s head.
Why is my old favicon still showing?
Browsers cache favicons aggressively. Check the file in public/ changed, open /favicon.svg directly, and test in a private window before assuming the build is wrong.