forge
forge copied to clipboard
[icon] add support for loading SVG icons from arbitrary URLs
Describe the feature:
The <forge-icon>
currently has a src
property/attribute that allows for providing any <svg>
element as a string
. This component should also support providing a custom URL to have the component attempt to load the <svg>
content from that URL to avoid having developers to have to fetch the content themselves and use the src
property.
Describe any alternatives you've considered:
Using the existing fetchIconContent(url, name)
method that is exported from the library to fetch the icon content from a URL, and then manually set the content using the src
property.
Additional context: Developers need to be sure that their SVG assets can be served over CORS if fetching from a different domain.