Course Content
Next.js 14 Mastery for Building Modern Web Apps
Next.js 14 Mastery for Building Modern Web Apps
1. Introduction to Next.js
2. Setting Up a Next.js Project
Setting Up the Next.js Project Understanding the Project File and Folder StructureStyling Approaches in Next.jsAdding the Global CSS FileUsing Tailwind CSS for StylingWorking with CSS ModulesApplying Styles ConditionallyAdding Custom Google FontsChallenge: Implementing a Custom Google FontHandling Images in Next.js
3. Building Pages and Layouts in Next.js
4. Deploying a Next.js App and Setting Up a Database
5. Fetching and Displaying Data in Next.js
6. Advanced Next.js Features and Optimizations
7. Implementing Authentication in Next.js
Understanding AuthenticationSetting Up the Login RouteUsing NextAuth.js for AuthenticationConfiguring Authentication and Protecting RoutesHashing Passwords and Managing CredentialsImplementing Sign-In FunctionalityConnecting the UI with Authentication LogicImplementing Logout FunctionalityFinal Thoughts and Next Steps
Adding Custom Google Fonts
Let's shift our attention towards the fonts to be used in the app.
The application's fonts are automatically optimized when we use the next/font
module with Next.js. The font files are downloaded at build time and hosted with your other static assets. As a result, when a user visits your application, there are no additional network requests for fonts, which helps improve performance.
Back to the Project
Let's add the custom Poppins Google font for our app.
- Create a new file called
fonts.ts
inside theapp/ui
folder; - Import the
Poppins
font from thenext/font/google
module; - We should also specify the font's
weight
andsubsets
.
We are ready to use the Poppins
font in the app. Let's apply it to the body
element in the app/layout.tsx
.
As a result, the entire app uses the Poppins
font.
In the next chapter, let's include additional fonts.
In Practice
Everything was clear?
Thanks for your feedback!
Section 2. Chapter 8