From the course: Master Next.js by Building Scalable Apps with Routing, Databases, and Performance
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Adding icons to the sidebar - Next.js Tutorial
From the course: Master Next.js by Building Scalable Apps with Routing, Databases, and Performance
Adding icons to the sidebar
Now, the final step for sidebar is the icons. We will place icons for all the menu items like this. So I will use the icons from heroicons.com. It is actually built by Tailwind team and they offer the JSX as well as the SVG code icons which makes it easy to use and also keeps the performance optimal as compared to installing a full-fledged library. We will create components for each icon in a separate file named icons.jsx and from there we will import icons as and when needed. So let's create the file inside the components folder and inside it, I'll say export const home icon, the arrow function. Now let me open the site and I'll copy the JSX for this home icon and paste it over here. Now similarly I will create the component for users icon and copy the JSX for the user icon from here and paste it. Next I will take the swatch icon and search for swatch and copy the JSX and finally the shopping bag icon and paste it. That's it. Now that we have the icons, let's go to the sidebar…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Introduction2m 36s
-
(Locked)
Project creation2m 41s
-
(Locked)
Creating sidebar component3m 34s
-
(Locked)
Working on sidebar3m 46s
-
(Locked)
Combining utility classes with @apply3m 54s
-
(Locked)
RQ: @layer and @apply—combining utility classes1m 37s
-
(Locked)
Styling the sidebar4m 56s
-
(Locked)
Adding icons to the sidebar3m 3s
-
(Locked)
Creating users page5m 43s
-
(Locked)
Creating add users form7m 8s
-
(Locked)
Implementing component-based architecture6m 34s
-
(Locked)
Creating button and input components4m 16s
-
(Locked)
Refactoring code structure2m 40s
-
(Locked)
Database creation2m 30s
-
(Locked)
Adding users with server action4m
-
(Locked)
Implementing hashing3m 19s
-
(Locked)
RQ: Implementing hashing2m 4s
-
(Locked)
Validating user creation3m 44s
-
(Locked)
Rendering users in the table5m 44s
-
(Locked)
Creating edit user page3m 33s
-
(Locked)
Dynamic default values for edit2m 45s
-
(Locked)
Updating user data3m 43s
-
(Locked)
Deleting user3m 41s
-
(Locked)
Creating delete confirmation popup4m 17s
-
(Locked)
Enabling confirmation popup5m 32s
-
(Locked)
Deleting user by confirmation popup2m 24s
-
(Locked)
Creating product type page4m 39s
-
(Locked)
Creating add product type page3m 36s
-
(Locked)
Adding product types and products models into the schema3m 37s
-
(Locked)
RQ: Adding models in the schema—product type and product1m 6s
-
(Locked)
Adding product type using server action4m 26s
-
(Locked)
Rendering product types into the table2m
-
(Locked)
Creating edit product type page3m 19s
-
(Locked)
Dynamic default values for product type2m 33s
-
(Locked)
Updating product type with server action2m 39s
-
(Locked)
Deleting product type with server action1m 50s
-
(Locked)
Creating products page3m 46s
-
(Locked)
Creating products interface for listing4m 50s
-
(Locked)
Creating add product page2m 57s
-
(Locked)
Completing add products form2m 55s
-
(Locked)
Creating switch component5m 10s
-
(Locked)
Creating file input component6m 17s
-
(Locked)
Rendering dynamic product types data in add product page2m 12s
-
(Locked)
Creating server action for adding products3m 4s
-
(Locked)
Implementing image storage functionality5m 53s
-
(Locked)
Completing add product functionality4m 13s
-
(Locked)
Rendering dynamic data in products table3m 53s
-
(Locked)
Creating edit product page3m 13s
-
(Locked)
Dynamic default values for product3m 44s
-
(Locked)
Render default values in switch and file input2m 39s
-
(Locked)
Updating product with server action5m 14s
-
(Locked)
RQ: Updating product with server action1m 39s
-
(Locked)
Deleting product with server action2m 3s
-
(Locked)
-
-
-
-
-