Next.js Discord

Discord Forum

How is font being applied here?

Unanswered
Genio posted this in #help-forum
Open in Discord
I am following the admin-dashboard tutorial from the next.js website. They are adding a font but i dont understand what they did



 import '@/app/ui/global.css';
import { inter } from '@/app/ui/fonts';
 
export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
<body className={`${inter.className} antialiased`}>{children}</body> //the class name part 
    </html>
  );
}


This is the font.tsx

import {Inter } from 'next/font/google' 

export const inter = Inter({ subsets: ['latin'] })

2 Replies