Aug 13th, 2022

How to use icons in Next.js

Author Picture

Dhairya Shah

Software Engineer

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.


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";

  Plant trees <TbChristmasTree />

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!