SVG guides
Practical guides to working with SVG files: changing colors, editing text, turning SVGs into React components and building icon sprites.
How to change the colors of an SVG
Change an SVG's colors by editing its fill and stroke, with CSS and currentColor, or with a free online recolor tool — with examples for each method.
How to edit text in an SVG
Edit the words, font, size and color of text in an SVG — in the code or visually in a browser editor — and why some SVG text can't be edited at all.
How to turn an SVG into a React component
Convert an SVG into a reusable React component: the JSX attribute changes it needs, how to pass size and color as props, TypeScript typing, and alternatives.
SVG sprite sheets, explained
What an SVG sprite is, how <symbol> and <use> work, how to build one from a set of icons, how to style sprite icons, and the pitfalls of ids and external files.
Why your SVG text changes font when converted to PNG
Converted an SVG to PNG and the text changed font? Why converters fall back to other fonts, and three fixes: embed it, outline the text, or convert with fonts.
How to convert a PNG or JPG to SVG
Turn a PNG or JPG into a true vector SVG by tracing it: which images work, the settings that matter, removing the background, and the embedded-bitmap trap.
How to make a favicon from an SVG
Make a complete favicon set from one SVG: favicon.ico sizes, the SVG favicon, Apple touch icon, web manifest and maskable icons, and the tags for your <head>.
How to reduce SVG file size
Why SVG files are bigger than they need to be, what an optimizer like SVGO removes, which optimizations are safe, and the ones that can break your icons.
How to use SVG in CSS
Use an SVG as a CSS background or icon: URL-encoded vs base64 data URIs, which is smaller, quoting rules, and mask-image so the icon takes the text colour.