0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00
astro/.changeset/blue-socks-doubt.md
Michael Stramel c48916cc4e
feat(astro): add Built-in SVG component support (#12067)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2024-11-19 16:51:37 +00:00

814 B

astro
minor

Adds experimental support for built-in SVG components.

This feature allows you to import SVG files directly into your Astro project as components. By default, Astro will inline the SVG content into your HTML output.

To enable this feature, set experimental.svg to true in your Astro config:

{
  experimental: {
    svg: true,
  },
}

To use this feature, import an SVG file in your Astro project, passing any common SVG attributes to the imported component. Astro also provides a size attribute to set equal height and width properties:

---
import Logo from './path/to/svg/file.svg';
---

<Logo size={24} />

For a complete overview, and to give feedback on this experimental API, see the Feature RFC.