react-google-fonts-css2

1.0.2 • Public • Published

REACT Google Fonts CSS2

React component for using https://github.com/adriano-tirloni/google-fonts-css2, refer to it for more information.

  • SSR Ready
  • This is a very simple component, it will append a stylesheet link on document head.
  • It doesn't verify is the Font Family name or styles is correct. It only generates the correct URL.

Installing and usage:

yarn add react-google-fonts-css2
import GoogleFontsCss2Loader from  'react-google-fonts-css2'

// Loading one font
  <GoogleFontsCss2Loader family='Quicksand' styles={[300, 400]} /> 


//Loading multiple fonts
  <GoogleFontsCss2Loader families={[
    {
      family: 'Quicksand',
      styles: [300, 400, '500italic']
    },
    {
      family: "Cabin",      // Family Name
      styles: [
        "600..700",         // Range, if family supports it.
        "100..200italic",   // Range with italic
        "300italic",        // Weight with italic
        "regular",          // Shortcut to 400
        "italic",           // Shortcut to 400 Italic
        "500",              // Regular with Weight
        444                 // Regular Weight for variable font
      ]
    }
  ]} /> 

Package Sidebar

Install

npm i react-google-fonts-css2

Weekly Downloads

25

Version

1.0.2

License

MIT

Unpacked Size

13.6 kB

Total Files

7

Last publish

Collaborators

  • adriano-tirloni