# Adding a custom SVG to a plugin

**URL:** https://meta.discourse.org/t/adding-a-custom-svg-to-a-plugin/327148
**Category:** Development
**Created:** [September 18, 2024, 8:59pm UTC](https://meta.discourse.org/t/adding-a-custom-svg-to-a-plugin/327148 "2024-09-18T20:59:37Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [September 18, 2024, 9:17pm UTC](https://meta.discourse.org/t/adding-a-custom-svg-to-a-plugin/327148/2 "2024-09-18T21:17:16Z")

</div>

`register_svg_icon` will work for any SVG, it isn’t specific to Font Awesome

So you’d add a new sprite with your icon, like `svg-icons/sprite.svg` — the guidance on the spritesheet is the same as [Replace Discourse's default SVG icons with custom icons in a theme](https://meta.discourse.org/t/replace-discourses-default-svg-icons-with-custom-icons-in-a-theme/115736) (so make sure to set an id)

Then in `plugin.rb` you can do:

`register_svg_icon "my-svg-id`"

---

_[View the full topic](https://meta.discourse.org/t/adding-a-custom-svg-to-a-plugin/327148)._
