# How to use icons in my javascript?

**URL:** https://meta.discourse.org/t/how-to-use-icons-in-my-javascript/265923
**Category:** Support
**Created:** [July 26, 2022, 9:22am UTC](https://meta.discourse.org/t/how-to-use-icons-in-my-javascript/265923 "2022-07-26T09:22:32Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Apocal](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Apocal](https://meta.discourse.org/u/Apocal)
#### Post date: [July 26, 2022, 9:22am UTC](https://meta.discourse.org/t/how-to-use-icons-in-my-javascript/265923/1 "2022-07-26T09:22:32Z")

</div>

> [@Introducing Font Awesome 5 and SVG icons](https://meta.discourse.org/t/introducing-font-awesome-5-and-svg-icons/101643/1):
>
> Using icons in your javascript

I don’t understand where I should add all those lines  
On my server, I can’t find where my theme directory is.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 26, 2022, 11:09am UTC](https://meta.discourse.org/t/how-to-use-icons-in-my-javascript/265923/2 "2022-07-26T11:09:13Z")

</div>

Hello and welcome @Apocal 🙂

Are you trying to add an icon to a theme component, or similar?

---

<div class="post-metadata">

### Author: ![Apocal](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Apocal](https://meta.discourse.org/u/Apocal)
#### Post date: [July 26, 2022, 11:24am UTC](https://meta.discourse.org/t/how-to-use-icons-in-my-javascript/265923/3 "2022-07-26T11:24:02Z")

</div>

> [@JammyDodger](#):
>
> Are you trying to add an icon to a theme component, or similar?

yes, i try upload my \*.svg costum icon with category icon component and i see like this.

i use my costum theme, from github.

my settings in Category components:

in my theme /assets direcotry upluad home-svgrepo-com.svg icon.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 26, 2022, 7:28pm UTC](https://meta.discourse.org/t/how-to-use-icons-in-my-javascript/265923/4 "2022-07-26T19:28:26Z")

</div>

Are you trying to add a custom icon to use in [Category Icons](https://meta.discourse.org/t/category-icons/104683)? Would you be able to add it through the theme UI rather than a custom theme component?

> [@Introducing Font Awesome 5 and SVG icons](https://meta.discourse.org/t/introducing-font-awesome-5-and-svg-icons/101643/1):
>
> You can also add the SVG sprite to a theme or component via the UI, when doing so, make sure the SCSS var name is set to `icons-sprite`. Screenshot:
> 
> ![image](https://global.discourse-cdn.com/meta/original/4X/f/1/9/f193ce6ad9125fb89f471edbdd7bd3fbda1811b9.png)

---

<div class="post-metadata">

### Author: ![Apocal](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Apocal](https://meta.discourse.org/u/Apocal)
#### Post date: [July 27, 2022, 8:29am UTC](https://meta.discourse.org/t/how-to-use-icons-in-my-javascript/265923/5 "2022-07-27T08:29:48Z")

</div>

Thanks for the help. I fixed everything and everything works.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [May 23, 2023, 1:32pm UTC](https://meta.discourse.org/t/how-to-use-icons-in-my-javascript/265923/6 "2023-05-23T13:32:57Z")

</div>


