Pricing Blog

Change SVG Icons - the easy way?

  • benajaephrath-1265661474727006330

    BenajaEphrath

    1 year ago

    Is there a way to replace the SVG icons quickly and easily without having to reset all the options? So let's say I really just want to change the icon without changing show/hide or styling....

    I've already asked the AI, but haven't found a useful answer.
  • andreasmoller-1265669377236271265

    Andreas Møller

    1 year ago

    you could if the attributes etc. should stay the same, you could just keep the svg tag and swap the content
    👌1
  • plusmin-1265670268018364579

    Armand

    1 year ago

    @BenajaEphrath Besides what Andreas mentione and perhaps not the exact answers you are looking for, but here goes anyway:
    1. You can paste the new SVG icons and then copy over the show/hide formula and the styling (although styling is a bit more work than just copying, setting classes and all that).
    OR
    2. Have a look at how the SVGs are set dynamically in this video (around that time marker): https://youtu.be/ICTzRosXYec?feature=shared&t=4319
    I've taken the approach in the video a step further and set each path in the SVG dynamically based on an array on the Icon key in my object (see screenshot)
    No idea if it's best practice though
    1265670268320485416-Screenshot_2567-07-24_at_20.57.08.png
    👌1