How to load external svg file in `SvgIcon` component
See original GitHub issueAll the demos in the doc shows loading svg as something like:
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z" />
I don’t know what this format is. But I wonder how I can load a svg from external file in SvgIcon component.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:11 (7 by maintainers)
Top Results From Across the Web
How to load external svg file in SvgIcon component #15452
for example, I have many svg files located on my disk at ../public/svg/... , I usually load them from local path. Just like...
Read more >How to load external svg file in `SvgIcon` in material-ui?
There is no way to use Path to load external svg. You should use <img /> inside de <Icon> according to this answer...
Read more >Load an External SVG Inside a “Use” Tag | egghead.io
Learn how to load a single SVG icon set from an external URL in order to take ... being requested for each icon,...
Read more >svg-loader: A Different Way to Work With External SVG
Load external SVGs as inline elements ... Simply put, it fetches the SVG files via XHR and loads them as inline elements, allowing...
Read more >How to use SVGs in React | Sanity.io guide
There are a few ways to use an SVG in a React app: Use it as a regular image; Import it as a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Head to https://github.com/mui-org/material-ui/issues/18782#issuecomment-569233631 if you are curious about the why someone would want to use the SvgIcon component in such a case.
Yes.