function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Florian.GümbelFlorian.Gümbel 

Get path of icon set

Hey there,

I built a react component that generates the lightning icon markup.
This coponent need the resource path of the icon set.

Actually I hardcoded the resource path into my application. But thats not best practive due this path changes from release to release.

My question is, if there is a posibility to receive the actual icon resource path from lightning.

Cheers
Flo
Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
Hello Florian,

I myself faced this problem once ago and I don't think it's possible. However, to avoid hard maintenance of changing the code you could use the Lightning Design System as ZIP Static Resource and update the resource when needed or from a release to another.

You can download here:
https://www.lightningdesignsystem.com/downloads/ (http://​https://www.lightningdesignsystem.com/downloads/)

You can also use a custom setting or metadate to change the path when needed but I would avoid this approach if possible. 

Hope to have helped!

Regards.

Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.
Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
Hi Florian,

It has just come to my attention that since Spring '17 we can use the global var $Asset in visualforce pages to access the lightning design system. So if you're using your React within a VF it would work for you as well.

https://releasenotes.docs.salesforce.com/en-us/spring17/release-notes/rn_vf_asset_variable.htm (http://​https://releasenotes.docs.salesforce.com/en-us/spring17/release-notes/rn_vf_asset_variable.htm)