Dhairya Shah
Dhairya Shah's Blog

Dhairya Shah's Blog

How to use icons in Next.js

How to use icons in Next.js

Dhairya Shah's photo
Dhairya Shah
·Aug 14, 2022·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

Icons are an important and valuable component of a website/application. So, let's see how we can make use of icons in Next. js

We'll be using the React icons library, which is lightweight and fast and contains a plethora of different icons.

image.png

Source: Bundlephobia

We first need in add the React icons package to our Next.js application,

npm install react-icons

After installing, head over to the React Icons Website with a list of icons.

import { TbChristmasTree } from "react-icons/tb";

<p>
  Plant trees <TbChristmasTree />
</p>

And that's how you add React icons in Next.js application.

Thank you for reading

Follow me on Twitter

Liked my content? Buy me a coffee to fuel my work. Thanks for reading!

 
Share this