How to use icons in Next.js

How to use icons in Next.js

ยท

1 min read

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!

ย