<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/use-svg-sprite-icons-in-react-e7wloeek6" -->

---
title: Use svg sprite icons in React | daily.dev
description: The best way to use icons is ansvg spritesheet. This is one of the oldest tactics to optimize image loading. Instead of loading many small images, we load a...
canonical: https://daily.dev/posts/use-svg-sprite-icons-in-react-e7wloeek6
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Use svg sprite icons in React | daily.dev
og:description: The best way to use icons is ansvg spritesheet. This is one of the oldest tactics to optimize image loading. Instead of loading many small images, we load a...
og:url: https://daily.dev/posts/use-svg-sprite-icons-in-react-e7wloeek6
og:image: https://api.daily.dev/og/posts/E7wLoEeK6.png
og:image:alt: Use svg sprite icons in React
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Use svg sprite icons in React

**[Community Picks](https://daily.dev/sources/community)** · 6 min read · 18 upvotes · 0 comments

## Summary

The best way to use icons is ansvg spritesheet. This is one of the oldest tactics to optimize image loading. Instead of loading many small images, we load a single image and use code to display only the part we need. We will also build a React component that displays a specific icon by name with full type safe autocomplete.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.jacobparis.com/content/svg-icons>

---

Tags: [#react](https://daily.dev/tags/react), [#cli](https://daily.dev/tags/cli), [#svg](https://daily.dev/tags/svg)

[View this post on daily.dev](https://daily.dev/posts/use-svg-sprite-icons-in-react-e7wloeek6)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Use svg sprite icons in React","url":"https://daily.dev/posts/use-svg-sprite-icons-in-react-e7wloeek6","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/use-svg-sprite-icons-in-react-e7wloeek6"},"datePublished":"2023-07-24T06:05:03.230Z","dateModified":"2023-12-07T12:02:45.284Z","description":"The best way to use icons is ansvg spritesheet. This is one of the oldest tactics to optimize image loading. Instead of loading many small images, we load a...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/3d430cd8ae9fa0417ff2d73be0440a94?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/3d430cd8ae9fa0417ff2d73be0440a94?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"Community Picks","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Community Picks","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1655817725/logos/community","url":"https://daily.dev/sources/community"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/use-svg-sprite-icons-in-react-e7wloeek6","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":18},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"react,cli,svg","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Community Picks","item":"https://daily.dev/sources/community"},{"@type":"ListItem","position":3,"name":"Use svg sprite icons in React"}]}
```

