#How do I use Astro Icon in client components without duplicating them ?

8 messages · Page 1 of 1 (latest)

wooden condor
#

I'm using Astro Icon to use icons in my Astro pages. My icons are SVGs stored in src/icons. How can I use them in a client component ? When I try and use the Icon component from Astro Icon it tells me that it cannot be used in a client component.

I'd like to be able to inline SVGs just like Astro Icon does, but in a client component (in Svelte for example).

GitHub

Inline and sprite-based SVGs in Astro made easy! Contribute to natemoo-re/astro-icon development by creating an account on GitHub.

plush crag
#

Hey Thomas, You will have to use Iconify since Astro Icon is a icon system made for Astro projects

wooden condor
plush crag
wooden condor
#

all right thank you for your help

potent bolt
devout sluice
#

You could also just render the svg with an img tag

wooden condor