> For the complete documentation index, see [llms.txt](https://docs.realmacsoftware.com/elements-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmacsoftware.com/elements-docs/using-elements/components/content-and-media/svg.md).

# SVG

The SVG component displays scalable vector artwork such as icons, logos, and illustrations. SVGs remain sharp at every size and can often be recoloured directly from Elements.

{% hint style="info" %}
By default, the component removes size, fill, stroke, and style attributes from the rendered SVG so its appearance can be controlled in the Inspector. The original resource stored in Elements is not changed.
{% endhint %}

### Supported Content and File Types

The component accepts SVG resources. Use the [Image](/elements-docs/using-elements/components/content-and-media/image.md) component for JPG, PNG, and other bitmap images.

### How to Use SVG

You’ll find SVG under **Media** in the Components list.

1. Drag **SVG** onto the page.
2. Drop an SVG from Finder or Resources into the SVG field.
3. Decide which embedded attributes Elements should remove.
4. Configure Fill, Stroke, Link, and Sizing.
5. Preview hover states in a browser.

### Component Settings

#### SVG

**SVG** selects the resource.

Under **Remove Attributes**, each switch controls whether Elements strips that attribute while rendering:

* **Size** — Removes embedded width and height. Enabled by default.
* **Fill** — Removes embedded fill attributes. Enabled by default.
* **Stroke** — Removes embedded stroke attributes. Enabled by default.
* **Styles** — Removes embedded style attributes. Enabled by default.

Disable a switch when the original SVG must retain that attribute.

#### Fill

**Type** can be None, Static, or Hover.

For Hover, **Over** chooses Self or Parent and **State** switches between Start and End.

Each visible state provides **Color** and **Opacity**. Both Start and End default to Surface 50 at 100% opacity.

#### Stroke

**Type** can be None, Static, or Hover. Hover provides Start and End states and can be triggered by Self or Parent.

Each state provides **Color**, **Opacity**, and **Width**. Colours default to Surface 50, opacity to 100%, and width to 1.

#### Link

Set **To** to make the SVG link to a page, resource, website, email address, phone number, anchor, or another supported destination.

### Preparing SVG Files

Elements can remove common attributes at render time, but the SVG’s internal structure still determines whether fills and strokes respond correctly.

* Remove fixed `width` and `height` values when the SVG does not resize as expected.
* Use `currentColor` for fill or stroke when the artwork is designed to inherit a colour.
* If `currentColor` prevents the Inspector from controlling the artwork, remove it and test again.
* Complex inline styles or multiple hard-coded fills may require editing in an SVG tool.

<figure><img src="/files/Jf17KnXPCtB3H4fRCCLU" alt="SVG code showing a fill attribute set to currentColor"><figcaption><p>Use currentColor—or remove a fixed fill—when the SVG should inherit its colour.</p></figcaption></figure>

<figure><img src="/files/XHdftgWIEzVj0W7EMJKZ" alt="SVG code with fixed width and height attributes highlighted for removal"><figcaption><p>Remove fixed width and height values when they prevent responsive sizing.</p></figcaption></figure>

For a practical workflow, see [SVG Cleanup with Sketch](https://forums.realmacsoftware.com/t/svg-cleanup-with-sketch-app/46751). You can use [Sketch](https://www.sketch.com) with the [SVGO Compressor plugin](https://sketchelements.com/plugins/svgo-compressor/).

{% embed url="<https://share.cleanshot.com/TsQRDhMX>" %}

### Free SVG Icon Libraries

* [Lucide](https://lucide.dev)
* [Tabler Icons](https://tabler.io/icons)
* [Feather Icons](https://feathericons.com)
* [Phosphor Icons](https://phosphoricons.com/)
* [SVGL](https://svgl.app)
* [Heroicons](https://heroicons.com/outline)
* [Google Material Symbols](https://fonts.google.com/icons)
* [Logoipsum](https://logoipsum.com/)

For a deeper introduction to working with SVG, see [Practical SVG](https://practical-svg.chriscoyier.net).

### Accessibility

Decorative SVGs should not duplicate nearby text. When an SVG conveys meaning, provide an accessible text label through the surrounding link, button, caption, or content structure.

### Troubleshooting

#### Fill or stroke does not change

Check for hard-coded fill, stroke, class, or style values inside the SVG. Enable the relevant Remove Attributes switches, or clean the file in an SVG editor.

#### The SVG does not resize

Enable **Remove Attributes → Size** or remove fixed width and height attributes from the source SVG, then use the component’s Sizing controls.

### Related Components

* [Image](/elements-docs/using-elements/components/content-and-media/image.md) — Displays bitmap images with responsive source and lightbox controls.
* [Mask](/elements-docs/using-elements/components/styling-and-effects/mask.md) — Uses an SVG to reveal wrapped content.

| Common Control                                                                                                     | Description                                                             |
| ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- |
| [Link](/elements-docs/using-elements/components/common-controls/link.md)                                           | Link to a page, resource, anchor, email address, or website.            |
| [Layout](/elements-docs/using-elements/components/common-controls/layout.md)                                       | Control positioning, stacking, visibility, overflow, and isolation.     |
| [Sizing](/elements-docs/using-elements/components/common-controls/sizing.md)                                       | Set width, height, and responsive size constraints.                     |
| [Spacing](/elements-docs/using-elements/components/common-controls/spacing.md)                                     | Add responsive margin and padding.                                      |
| [Typography & Text Styles](/elements-docs/using-elements/components/common-controls/typography-and-text-styles.md) | Control fonts, text spacing, decoration, colour, and semantic wrappers. |
| [Backgrounds](/elements-docs/using-elements/components/common-controls/backgrounds.md)                             | Apply colour, image, gradient, SVG, video, and hover backgrounds.       |
| [Transitions](/elements-docs/using-elements/components/common-controls/transitions.md)                             | Choose what animates and set its timing curve, duration, and delay.     |
| [Effects](/elements-docs/using-elements/components/common-controls/effects.md)                                     | Apply shadows, opacity, and hover effects.                              |
| [Filters](/elements-docs/using-elements/components/common-controls/filters.md)                                     | Apply blur, brightness, saturation, shadow, and backdrop effects.       |
| [Transforms](/elements-docs/using-elements/components/common-controls/transforms.md)                               | Scale, rotate, move, and skew components.                               |
| [Borders](/elements-docs/using-elements/components/common-controls/borders.md)                                     | Set border style, colour, opacity, width, radius, and hover states.     |
| [Advanced](/elements-docs/using-elements/components/common-controls/advanced.md)                                   | Add CSS classes and IDs, or change supported HTML tags.                 |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.realmacsoftware.com/elements-docs/using-elements/components/content-and-media/svg.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
