Complete the code to import the Roboto font using next/font.
import { [1] } from 'next/font/google'; const roboto = [1]({ subsets: ['latin'] });
The correct import is Roboto from next/font/google. It matches the font name exactly.
Complete the code to apply the imported font's className to a div.
export default function Home() {
return <div className=[1]>Hello World</div>;
}The font object has a className property to apply the font styles. It is accessed as roboto.className.
Fix the error in the font import statement.
import [1] from 'next/font/google';
The import must use named import syntax with curly braces: { Roboto }.
Fill both blanks to import and configure the Inter font with weight 400.
import [1] from 'next/font/google'; const inter = [2]({ weight: '400', subsets: ['latin'] });
Import uses named import { Inter }. Then call Inter to configure the font.
Fill all three blanks to create a custom font with variable and apply its className in JSX.
import [1] from 'next/font/google'; const customFont = [2]({ subsets: ['latin'] }); export default function Page() { return <main className=[3]>Welcome</main>; }
Import the font as named import { Lato }, call Lato to create the font object, then use customFont.className in JSX.