Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Custom Google Fonts | Basic Concepts
Next.js 14
course content

Conteúdo do Curso

Next.js 14

Next.js 14

1. Introduction
2. Basic Concepts
3. Pages and Layouts
4. Deployment and Database
5. Working with Data
6. Advanced Features
7. Authentication

bookCustom 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.

  1. Create a new file called fonts.ts inside the app/ui folder;
  2. Import the Poppins font from the next/font/google module;
  3. We should also specify the font's weight and subsets.

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

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 8
some-alt