JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1021
  • Score
    100M100P100Q126875F
  • License BSD-3-Clause

Webfontloader for React

Package Exports

  • @dr-kobros/react-webfont-loader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@dr-kobros/react-webfont-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Webfonts loader for React

What?

A React wrapper for Typekit's webfontloader NPM package.

How?

import { render } from 'react-dom';
import WebfontLoader from '@dr-kobros/react-webfont-loader';

// webfontloader configuration object
const config = {
  google: {
    families: ['Source Sans Pro:300,600'],
  }
};

// Callback receives the status of the webfont loading process.
const callback = status => {
  // I could hook the webfont status to for example Redux here.
}

// wrap your root component with the supplied wrapper component
render(
  <WebfontLoader config={config} callback={callback}>
    <App />
  </WebfontLoader>,
  document.getElementById('app')
);