JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 31156
  • Score
    100M100P100Q148258F
  • License MIT

A React component for the font-awesome icon library.

Package Exports

  • react-fontawesome

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 (react-fontawesome) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-fontawesome

styled with prettier Travis CI build status Dependency Status View on npm View on npm

A React component for the font-awesome icon library.

Install

npm install --save react-fontawesome

Usage

var React = require('react');
var FontAwesome = require('react-fontawesome');

React.render(<FontAwesome name='rocket' />, document.body);

Features

  • No dependencies (other than React)
  • Simple API that mirrors Font Awesome's class names.
  • Supports all Font Awesome modifiers (see API below).
  • Add your own classNames, styles and other props (all additional props are passed directly to the component).

Note: This component does not include any of the Font Awesome CSS or fonts, so you'll need to make sure to include those on your end somehow, either by adding them to your build process or linking to CDN versions.

Examples

var React = require('react');
var FontAwesome = require('react-fontawesome');

var MyComponent = React.createClass({
  render: function () {
    return (
      <FontAwesome
        className='super-crazy-colors'
        name='rocket'
        size='2x'
        spin
        style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }}
      />
    );
  }
});

API

See the API docs for full documentation.

Contributing

Pull requests welcome!

Run the test suite with npm test and format your code with npm run format. Make sure tests are passing and that you write tests for new features and document changes to the API with updates to the JSDocs.

Before you submit your pull request, run npm run dist to build the project and commit the changes.

License

MIT © Dana Woodman