'how to use a font from google font just to be used in one react component with material UI?

i got only one Typography element that uses a different font than the rest of the application , could someone advise what's the best way to get the font from google font website for jus this component.



Solution 1:[1]

If you want to use google font, the easiest way is to add the cdn link in the <head> of your html. Then you may use like this:

<Typography sx={{fontFamily: "Merriweather" }}>
  Sample Text
</Typography>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 johnny-robot