question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to load external svg file in `SvgIcon` component

See original GitHub issue

All 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:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
oliviertassinaricommented, Feb 11, 2020

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.

1reaction
oliviertassinaricommented, Aug 19, 2019

Yes.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found