# Change Icon Image in a Switch or Button

**URL:** https://discourse.nodered.org/t/change-icon-image-in-a-switch-or-button/34670
**Category:** General
**Created:** [22 October 2020 10:29 UTC](https://discourse.nodered.org/t/change-icon-image-in-a-switch-or-button/34670 "2020-10-22T10:29:55Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![LucaCarminati](https://avatars.discourse-cdn.com/v4/letter/l/43a26b/32.png) [@LucaCarminati](https://discourse.nodered.org/u/LucaCarminati)
#### Post date: [22 October 2020 10:29 UTC](https://discourse.nodered.org/t/change-icon-image-in-a-switch-or-button/34670/1 "2020-10-22T10:29:56Z")

</div>

Hi to all,  
I have a question, can I change the button Icon with a mine personal icon?  
I've already tried the fa-xxx icon and they works, but they are not what I need.

 ![button icon](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/7/77e50032d38a22ce7317510f11e052dff4d19ed9.png)

Maybe is there a code to put in a function node where I link my icon that is insert in a folder?  
I have already read different similar post in the forum but I didn't find a real solution about that.

\*off topic \*

my future goal is, if I'll find a solution about my question, to don't use my personalized icon inserted in a folder but find a mode to insert the icon using image in format BASE64 so I'll not need anymore folder in my PC full of svg image.

---

<div class="post-metadata">

### Author: ![lizzardguki](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lizzardguki/32/103637_2.png) [@lizzardguki](https://discourse.nodered.org/u/lizzardguki)
#### Post date: [22 October 2020 10:34 UTC](https://discourse.nodered.org/t/change-icon-image-in-a-switch-or-button/34670/2 "2020-10-22T10:34:32Z")

</div>

I think it is not possible, you can only use font awesome icons, and node-red ones.  
I haven't needed anything like this, but if you want to do something like this i think ui-builder is your best friend...

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [22 October 2020 10:40 UTC](https://discourse.nodered.org/t/change-icon-image-in-a-switch-or-button/34670/3 "2020-10-22T10:40:45Z")

</div>

From the node's help

> The **Icon** can be defined, as either a [Material Design icon](https://klarsys.github.io/angular-material-icons/)_(e.g. 'check', 'close')_ or a [Font Awesome icon](https://fontawesome.com/v4.7.0/icons/)_(e.g. 'fa-fire')_ , or a [Weather icon](https://github.com/Paul-Reed/weather-icons-lite/blob/master/css_mappings.md). You can use the full set of google material icons if you add 'mi-' to the icon name. e.g. 'mi-videogame\_asset'.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [22 October 2020 12:34 UTC](https://discourse.nodered.org/t/change-icon-image-in-a-switch-or-button/34670/4 "2020-10-22T12:34:49Z")

</div>

Also you can use a ui\_template node to make a switch that shows whatever you like.

---

<div class="post-metadata">

### Author: ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)
#### Post date: [22 October 2020 12:51 UTC](https://discourse.nodered.org/t/change-icon-image-in-a-switch-or-button/34670/5 "2020-10-22T12:51:11Z")

</div>

@LucaCarminati did you read this ?

> [@SWITCH & BUTTON ui node : how to change color, background color, size](https://discourse.nodered.org/t/switch-button-ui-node-how-to-change-color-background-color-size/33799):
>
> I see that a lot of us are struggling to customize their buttons in the Dashboard. So here are two very simple flows to modify using messages: the icon, the icon color, the size (for the Font Awesome icon), the background color (for the Button node) of these buttons. This First example modify Switch button : [image] The result : [image] [image] [image] [image] Note : you can clic on the icon to change his state. A msg. payload is send eg: true or false [{"id":"f451dbff.2559c8","type":"f…

---

<div class="post-metadata">

### Author: ![LucaCarminati](https://avatars.discourse-cdn.com/v4/letter/l/43a26b/32.png) [@LucaCarminati](https://discourse.nodered.org/u/LucaCarminati)
#### Post date: [22 October 2020 21:41 UTC](https://discourse.nodered.org/t/change-icon-image-in-a-switch-or-button/34670/6 "2020-10-22T21:41:12Z")

</div>

Yes! Thanks man

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [5 November 2020 21:41 UTC](https://discourse.nodered.org/t/change-icon-image-in-a-switch-or-button/34670/7 "2020-11-05T21:41:13Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
