Skip to main content
Roger.ch
Associate III
August 3, 2023
Solved

Button with svg image?

  • August 3, 2023
  • 1 reply
  • 2625 views

Hello everyone

Can I also add an svg image to a button? I can embed images in svg format (almost) without any problems. However, if I want to assign an image to a flex button, only png works. Is there a workaround for this or does it just not work?

Regards, Roger

This topic has been closed for replies.
Best answer by Mohammad MORADI ESFAHANIASL

Hello @Roger.ch ,

Unfortunately, SVGs are not supported on buttons yet. You can only use SVG as standalones.

However, you can use an 'SVG Image' and then enable ClickListener option for it under the Mixins section. This way you can have the click functionality of a button, and you can manually (I mean from the code) set different SVGs for different click events (but it might be a bit tricky to handle perfectly) to imitate Released or Clicked states.

Good luck

1 reply

ST Employee
September 21, 2023

Hello @Roger.ch ,

Unfortunately, SVGs are not supported on buttons yet. You can only use SVG as standalones.

However, you can use an 'SVG Image' and then enable ClickListener option for it under the Mixins section. This way you can have the click functionality of a button, and you can manually (I mean from the code) set different SVGs for different click events (but it might be a bit tricky to handle perfectly) to imitate Released or Clicked states.

Good luck

Mohammad MORADIST Software Developer | TouchGFX