Socket
Socket
Sign inDemoInstall

react-fontawesome

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-fontawesome

A React FontAwesome component.


Version published
Weekly downloads
41K
increased by2.44%
Maintainers
1
Weekly downloads
 
Created
Source

react-fontawesome

A React component for the font-awesome icon library.

  • Simple API that mirrors Font Awesome's classes.
  • 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).
  • Standard, non-ES6 JavaScript, so should work most places without a build step.
    • Packaged as a CommonJS/npm module.
    • Doesn't use JSX so no transforms needed.
    • Does not require a specific build process/tool other than something that supports npm.

Usage

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)' }}
      />
    );
  }
});

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 the CDN versions.

API

Prop NameTypeDefaultDescription
borderbooleanfalse
fixedWidthbooleanfalse
flipstring''Choices: 'horizontal' or 'vertical'
inversebooleanfalse
namestring''Required: 'check', 'cloud', 'person', etc... (e.g. any Font Awesome icon class name, minus the fa- prefix)
pulsebooleanfalse
rotatestring''Choices: '90', '180' or '270'
sizestring''Choices: 'lg', '2x', '3x', '4x' or '5x'
spinbooleanfalse
stackstring''Choices: '1x' or '2x'

Contributing

Pull requests welcome!

Please use the .editorconfig, .jsfmtrc and .jshintrc configurations in your editor to ensure proper formatting.

Run the test suite with npm test, make sure tests are passing and that you write tests for new features.

Credits

Created by Dana Woodman of BIG. Inspired by react-fa.

License

Licensed under the generous MIT license.

Keywords

FAQs

Package last updated on 22 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc