SVGR is used to generate the icons from svg files, provides a simple way to optimise svg files and use them in your application.
Follow the following step to add a new icon to your application:
- Create a new svg file in the
svgs
directory. - Naming the file should be the same as the icon name excluding icon prefix. e.g. if you want to add a new icon named
<IconFacebook />
then the file name should befacebook.svg
. - Run
build
command in icons directory to generate the icon component. - Add the icon component to your application.
ViteJS is used to generate the icons showcase page.
- Run
npm run build:icons
to generate the icons that will be used by the showcase page. - Run
npm run dev
to start the server and open the page in your browser.
- Go to
data/tags.ts
and add the new icon name along with thetags
array. - If you want to display icon as "new", just add
new
in thetags
array. - e.g.
'facebook' : ["faang", "social", "new"]
icon will be displayed as "new" in the showcase page.