paint-brush
How to Create SVG Sprite With Iconsby@gmakarov
3,077 reads
3,077 reads

How to Create SVG Sprite With Icons

by German Makarov10mDecember 23rd, 2023
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

Developers often insert SVG directly into JSX. This is convenient to use, but it increases the JS bundle size. In the pursuit of optimization, I decided to find another way of using SVG icons without cluttering the bundle. We will talk about SVG sprites, what they are, how to use them, and what tools are available for working with them. Starting with theory, we will write a script that generates an SVG sprite step by step and conclude by discussing plugins for vite and webpack.

Company Mentioned

Mention Thumbnail
featured image - How to Create SVG Sprite With Icons
German Makarov HackerNoon profile picture
German Makarov

German Makarov

@gmakarov

Senior Software Engineer | Frontend | React | TypeScript

About @gmakarov
LEARN MORE ABOUT @GMAKAROV'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

German Makarov HackerNoon profile picture
German Makarov@gmakarov
Senior Software Engineer | Frontend | React | TypeScript

TOPICS

Languages

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite