Introduction
svgin-react fetches an SVG from a URL, or takes raw markup directly, and renders it as a real, styleable React element instead of an <img>. It sanitizes the SVG with DOMPurify by default, so it is safe to use with SVGs from a source you do not fully control, and it works both as a client component and in React Server Components.
Client component
Renders on the browser. Manages its own loading/error state.
Server component
Fetches and sanitizes entirely on the server. No client JS ships for it.
Continue to Installation or jump straight to the API reference.