#Import svg as component with solid
7 messages · Page 1 of 1 (latest)
Hi @high sedge. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Yes, Astro supports using Solid as a first-class framework in your project. To import an SVG as a component, you can use the import statement in your Astro or Solid component. Here's an example:
import rocket from '../images/rocket.svg';
Then, you can use the imported SVG in your component like this:
<img src={rocket} alt="A rocketship in space." />
For more information on using Solid with Astro, refer to the Astro documentation on Solid (https://docs.astro.build/en/guides/integrations-guide/solid-js).
For more information on importing assets in Astro, refer to the Astro documentation on imports (https://docs.astro.build/en/guides/imports).
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@high sedge kapa.ai is still learning and improving, please let us how it did by reacting below
@gaunt wolf ok, but I want a import this svg as a component, like a vite plugin does
Let me check the knowledge base for you. One moment! :books: