#inline svg
1 messages · Page 1 of 1 (latest)
Hi @weak bay. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Yes, you can make your SVGs easier to manage in your Astro application by defining your SVG in an Astro component. Here's an example from one of the GitHub issues (https://github.com/withastro/astro/issues/958) on how you might do this:
---
import { Once } from 'astro/components';
---
<Once>
<svg viewBox="0 0 30 10" xmlns="<http://www.w3.org/2000/svg">>
<circle id="myCircle" cx="5" cy="5" r="4" stroke="blue"/>
</svg>
</Once>
In this example, the SVG is defined in a component named Circle.astro. You can then use this component as many times as you want in your application, which can help keep your code clean and manageable.