{"name":"@fortawesome/react-fontawesome","description":"Official React component for Font Awesome 5","version":"0.1.0-10","main":"index.js","module":"index.es.js","jsnext:main":"index.es.js","types":"index.d.ts","homepage":"https://github.com/FortAwesome/react-fontawesome","repository":{"type":"git","url":"git+https://github.com/FortAwesome/react-fontawesome.git"},"contributors":[{"name":"Travis Chase","email":"travis@fontawesome.com"},{"name":"Rob Madole","email":"rob@fontawesome.com"},{"name":"Mike Wilkerson","email":"mwilkerson@gmail.com"}],"license":"MIT","scripts":{"build":"rollup -c rollup.config.js","dist":"cross-env NODE_ENV=production npm run build","lint":"eslint src","prettier":"pretty-quick src --staged","precommit":"npm run lint && npm run prettier","prepack":"npm run dist","test":"jest","clean":"rm -f index.js && rm -f index.es.js"},"peerDependencies":{"@fortawesome/fontawesome-svg-core":"^1.2.0-7","react":"16.x"},"devDependencies":{"@fortawesome/fontawesome-svg-core":"^1.2.0-7","@types/react":"^16.1.0","babel-core":"^6.26.0","babel-eslint":"^8.2.1","babel-jest":"^22.4.3","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.6.1","babel-preset-react":"^6.24.1","babel-preset-stage-3":"^6.24.1","cross-env":"^5.1.1","eslint":"^4.19.1","eslint-config-standard":"^11.0.0-beta.0","eslint-plugin-import":"^2.8.0","eslint-plugin-jest":"^21.7.0","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.6.0","eslint-plugin-react":"^7.5.1","eslint-plugin-standard":"^3.0.1","husky":"^0.14.3","jest":"^22.4.3","prettier":"^1.11.1","pretty-quick":"^1.2.2","prop-types":"^15.5.10","react":"^16.2.0","react-test-renderer":"^16.2.0","rollup":"^0.57.1","rollup-plugin-babel":"^3.0.2","rollup-plugin-commonjs":"^9.1.0","rollup-plugin-node-resolve":"^3.3.0"},"dependencies":{"humps":"^2.0.1","prop-types":"^15.5.7"},"files":["index.js","index.es.js","index.d.ts"],"readme":"# react-fontawesome\n\n[![npm](https://img.shields.io/npm/v/@fortawesome/react-fontawesome.svg?style=flat-square)](https://www.npmjs.com/package/@fortawesome/react-fontawesome)\n\n> Font Awesome 5 React component using SVG with JS\n\nHey there! We're glad you're here...\n\n#### Upgrading Font Awesome?\n\nIf you've used Font Awesome in the past (version 4 or older) there are some\nthings that you should learn before you dive in.\n\n> https://fontawesome.com/how-to-use/upgrading-from-4\n\n#### Get started\n\nThis package is for integrating with React. If you aren't using React then it's\nnot going to help you. Head over to our \"Get Started\" page for some guidance.\n\n> https://fontawesome.com/get-started\n\n#### Learn about our new SVG implementation\n\nThis package, under the hood, uses SVG with JS and the `@fortawesome/fontawesome-svg-core` library. This implementation differs drastically from\nthe web fonts implementation that was used in version 4 and older of Font Awesome. You might head over there to learn about how it works.\n\n> https://fontawesome.com/how-to-use/svg-with-js\n\n#### Going from 0.0.x to 0.1.0\n\nSee [UPGRADING.md](./UPGRADING.md).\n\nYou might also be interested in the larger umbrella project [UPGRADING.md](https://github.com/FortAwesome/Font-Awesome/blob/master/UPGRADING.md)\n\n## Installation\n\n```\n$ npm i --save @fortawesome/fontawesome-svg-core@prerelease\n$ npm i --save @fortawesome/free-solid-svg-icons@prerelease\n$ npm i --save @fortawesome/react-fontawesome@prerelease\n$ npm i --save prop-types\n```\n\nThis project uses the `prop-types` library. To give you, the developer, control over which version is installed we list this as a [peer dependency](https://nodejs.org/en/blog/npm/peer-dependencies/).\n\n## Add more styles or Pro icons\n\nBrands are separated into their own style and for customers upgrading from\nversion 4 to 5 we have a limited number of Regular icons available.\n\n**Visit [fontawesome.com/icons](https://fontawesome.com/icons) to search for free and Pro icons**\n\n```\n$ npm i --save @fortawesome/free-brands-svg-icons@prerelease\n$ npm i --save @fortawesome/free-regular-svg-icons@prerelease\n```\n\nIf you are a [Font Awesome Pro](https://fontawesome.com/pro) subscriber you can install Pro packages.\n\n```\n$ npm i --save @fortawesome/pro-solid-svg-icons@prerelease\n$ npm i --save @fortawesome/pro-regular-svg-icons@prerelease\n$ npm i --save @fortawesome/pro-light-svg-icons@prerelease\n```\n\nUsing the Pro packages requires [additional configuration](https://fontawesome.com/how-to-use/js-component-packages).\n\n## or with Yarn\n\n```\n$ yarn add @fortawesome/fontawesome-svg-core@prerelease\n$ yarn add @fortawesome/free-solid-svg-icons@prerelease\n$ yarn add @fortawesome/react-fontawesome@prerelease\n```\n\n## Usage\n\nYou can use Font Awesome icons in your React components as simply as this:\n\n```javascript\n<FontAwesomeIcon icon=\"coffee\" />\n```\n\nThat simple usage is made possible when you add the `\"coffee\"` icon, to the\n_library_.\n\nThis is one of the two ways you can use Font Awesome 5 with React. We'll\nsummarize all three ways briefly and then get into the details of each below.\n\n1.  **Explicit Import**\n\n    Allows icons to be subsetted, optimizing your final bundle. Only the icons\n    you import are included in the bundle. However, explicitly importing icons\n    into each of many components in your app might become tedious, so you may\n    want to build a library.\n\n2.  **Build a Library**\n\n    Explicitly import icons just once in some init module. Then add them to the\n    library. Then reference any of them by icon name as a string from any\n    component. No need to import the icons into each component once they're in\n    the library.\n\n### Explicit Import\n\nFor this example, we'll also reference the `@fortawesome/free-solid-svg-icons`\nmodule, so make sure you've added it to the project as well:\n\n```\n$ npm i --save @fortawesome/free-solid-svg-icons@prerelease\n```\n\nor\n\n```\n$ yarn add @fortawesome/free-solid-svg-icons@prerelease\n```\n\nNow, a simple React component might look like this:\n\n```javascript\nimport ReactDOM from 'react-dom'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport { faCoffee } from '@fortawesome/free-solid-svg-icons'\n\nconst element = <FontAwesomeIcon icon={faCoffee} />\n\nReactDOM.render(element, document.body)\n```\n\nNotice that the `faCoffee` icon is imported from\n`@fortawesome/free-solid-svg-icons` as an object and then provided to the\n`icon` prop as an object.\n\nExplicitly importing icons like this allows us to subset Font Awesome's\nthousands of icons to include only those you use in your final bundled file.\n\n### Build a Library to Reference Icons Throughout Your App More Conveniently\n\nYou probably want to use our icons in more than one component in your app,\nright?\n\nBut with explicit importing, it could become tedious to import into each of\nyour app's components every icon you want to reference in that component.\n\nSo, add them to the _library_. Do this setup once in some initializing module\nof your app, adding all of the icons you'll use in your app's React components.\n\nSuppose `App.js` initializes my app, including the library. For this example,\nwe'll add two individual icons, `faCheckSquare` and `faCoffee`. We also add all\nof the brands in `@fortawesome/free-brands-svg-icons`. This example would\nillustrate the benefits of building a library even more clearly if it involved\nfifty or a hundred icons, but we'll keep the example brief and leave it to your\nimagination as to how this might scale up with lots of icons.\n\nDon't forget to add `@fortawesome/free-brands-svg-icons`:\n\n```\n$ npm i --save @fortawesome/free-brands-svg-icons@prerelease\n```\n\nor\n\n```\n$ yarn add @fortawesome/free-brands-svg-icons@prerelease\n```\n\nIn `App.js`, where our app is initialized:\n\n```javascript\nimport ReactDOM from 'react-dom'\nimport { library } from '@fortawesome/fontawesome-svg-core'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport { fab } from '@fortawesome/free-brands-svg-icons'\nimport { faCheckSquare, faCoffee } from '@fortawesome/free-solid-svg-icons'\n\nlibrary.add(fab, faCheckSquare, faCoffee)\n```\n\nOK, so what's happening here?\n\nIn our call to `library.add()` we're passing\n\n* `fab`: which represents _all_ of the brand icons in\n  `@fortawesome/free-brands-svg-icons`. So any of the brand icons in that\n  package may be referenced by icon name as a string anywhere else in our app.\n  For example: `\"apple\"`, `\"microsoft\"`, or `\"google\"`.\n* `faCheckSquare` and `faCoffee`: Adding each of these icons individually\n  allows us to refer to them throughout our app by their icon string names,\n  `\"check-square\"` and `\"coffee\"`, respectively.\n\nNow, suppose you also have React components `Beverage` and `Gadget` in your app.\nYou don't have to re-import your icons into them. Just import the `FontAwesomeIcon`\ncomponent, and when you use it, supply the icon prop an icon name as a string.\n\nWe'll make `Beverage.js` a functional component:\n\n```javascript\nimport React from 'react'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\n\nexport const Beverage = () => (\n  <div>\n    <FontAwesomeIcon icon=\"check-square\" />\n    Favorite beverage: <FontAwesomeIcon icon=\"coffee\" />\n  </div>\n)\n```\n\nThere's one another piece of magic that's happening in the background when\nproviding icon names as strings like this: the `fas` prefix (for Font Awesome\nSolid) is being inferred as the default. Later, we'll look at what that means\nand how we can do something different than the default.\n\nNow suppose `Gadget.js` looks like this:\n\n```javascript\nimport React from 'react'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\n\nexport const Gadget = () => (\n  <div>\n    <FontAwesomeIcon icon=\"check-square\" />\n    Popular gadgets come from vendors like:\n    <FontAwesomeIcon icon={['fab', 'apple']} />\n    <FontAwesomeIcon icon={['fab', 'microsoft']} />\n    <FontAwesomeIcon icon={['fab', 'google']} />\n  </div>\n)\n```\n\nNotice:\n\n* We used the `\"check-square\"` icon name again in this component, though we\n  didn't have to explicitly import it into this component. With one explicit\n  import of that icon in `App.js`, and adding it to the library, we've managed\n  to use it by name in multiple components.\n* We used the `\"apple\"`, `\"microsoft\"`, and `\"google\"` brand icons, which were\n  never explicitly _individually_ imported, but they're available to us by name\n  as strings because `fab` was added to our library in `App.js`, and `fab`\n  includes all of those icons.\n* We added the `fab` prefix to reference those brand icons.\n\nAdding a prefix—and the syntax we used to do it—are new. So what's\ngoing on here?\n\nFirst, recall when we introduced `<FontAwesomeIcon icon=\"coffee\"/>` and learned\nthat a prefix of `fas` was being added to `\"coffee\"` by default.\n\nThe `\"check-square\"` icon is getting a default prefix of `fas` here too, which\nis what we want, because that icon also lives in the\n`@fortawesome/free-solid-svg-icons` package.\n\nHowever, the `\"apple\"`, `\"microsoft\"`, and `\"google\"` brand icons live in the\npackage `@fortawesome/free-brands-svg-icons`. So we need to specify a\ndifferent prefix for them—not the default `fas`, but `fab`, for Font Awesome\n_Brand_.\n\nWhen specifying a prefix with an icon name, both are given as strings.\n\nNow, what about that syntax?\n\nThe `icon` prop expects a single object:\n\n* It could be an icon object, like `{faCoffee}`.\n* It could a string object, like `\"coffee\"`.\n  (The curly braces around a string object supplied to a prop are optional,\n  so we've omitted them.)\n* Or it could be an `Array` of strings, where the first element is a prefix,\n  and the second element is the icon name: `{[\"fab\", \"apple\"]}`\n\n### Processing `<i>` tags into `<svg>` using Font Awesome\n\nOur hope and intention is that React users will use this package (`react-fontawesome`)\nwhen using Font Awesome. This component leverages React's architecture and philosophy.\n\nHowever, **if you cannot use these components everywhere in your app and still\nhave `<i>` tags on your page that need to be converted to `<svg>` tags we can\nstill help you**.\n\nA basic installation of [Font Awesome](https://fontawesome.com/get-started) has\nthe ability to automatically transform `<i class=\"fas fa-coffee\"></i>` into\n`<svg class=\"...\">...</svg>` icons. This technology works with the browser's\nDOM, [`requestAnimationFrame`][raf], and [`MutationObserver`][mo].\n\nWhen using the `@fortawesome/fontawesome-svg-core` package this **behavior is\ndisabled by default**. (We would _highly_ recommend you use `FontAwesomeIcon`\nif you can) This project uses that core package so you will have to explicitly\nenable it like this:\n\nTo configure the core library to convert non-React'ified parts of your App:\n\n```javascript\nimport { dom } from '@fortawesome/fontawesome-svg-core'\n\ndom.watch() // This will kick of the initial replacement of i to svg tags and configure a MutationObserver\n```\n\n[raf]: https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame\n[mo]: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver\n\n## Features\n\nThe following features are available as [part of Font Awesome](https://fontawesome.com/how-to-use/svg-with-js).\n\nIn the following code snippets, we'll use the shortcut notation for the\nicons—referencing the icons by their names as strings.\n\nBut remember, that option is only valid after you've either\nexplicitly imported and added those icons to the library, or externally\nloaded an icon bundle. See the sections above for the details.\n\n### Basic\n\nSpin and pulse animation:\n\n```javascript\n<FontAwesomeIcon icon=\"spinner\" spin />\n<FontAwesomeIcon icon=\"spinner\" pulse />\n```\n\nFixed width:\n\n```javascript\n<FontAwesomeIcon icon=\"spinner\" fixedWidth />\n```\n\nInverse:\n\n```javascript\n<FontAwesomeIcon icon=\"spinner\" inverse />\n```\n\nBorder:\n\n```javascript\n<FontAwesomeIcon icon=\"spinner\" border />\n```\n\nList items:\n\n```javascript\n<FontAwesomeIcon icon=\"spinner\" listItem />\n```\n\nFlip horizontally, vertically, or both:\n\n```javascript\n<FontAwesomeIcon icon=\"spinner\" flip=\"horizontal\" />\n<FontAwesomeIcon icon=\"spinner\" flip=\"vertical\" />\n<FontAwesomeIcon icon=\"spinner\" flip=\"both\" />\n```\n\nSize:\n\n```javascript\n<FontAwesomeIcon icon=\"spinner\" size=\"xs\" />\n<FontAwesomeIcon icon=\"spinner\" size=\"lg\" />\n<FontAwesomeIcon icon=\"spinner\" size=\"6x\" />\n```\n\nRotation:\n\n```javascript\n<FontAwesomeIcon icon=\"spinner\" rotation={90} />\n<FontAwesomeIcon icon=\"spinner\" rotation={180} />\n<FontAwesomeIcon icon=\"spinner\" rotation={270} />\n```\n\nPull left or right:\n\n```javascript\n<FontAwesomeIcon icon=\"spinner\" pull=\"left\" />\n<FontAwesomeIcon icon=\"spinner\" pull=\"right\" />\n```\n\nYour own class names:\n\n```javascript\n<FontAwesomeIcon icon=\"spinner\" className=\"highlight\" />\n```\n\n### Advanced\n\nPower Transforms:\n\n```javascript\n<FontAwesomeIcon icon=\"spinner\" transform=\"shrink-6 left-4\" />\n<FontAwesomeIcon icon=\"spinner\" transform={{ rotate: 42 }} />\n```\n\nComposition:\n\n```javascript\n<FontAwesomeIcon icon=\"coffee\" mask={['far', 'circle']} />\n```\n\nSymbols:\n\n```javascript\n<FontAwesomeIcon icon=\"edit\" symbol />\n<FontAwesomeIcon icon=\"edit\" symbol=\"edit-icon\" />\n```\n\nLayering:\n\n```javascript\n<span className=\"fa-layers fa-fw\">\n  <FontAwesomeIcon icon=\"square\" color=\"green\" />\n  <FontAwesomeIcon icon=\"check\" inverse transform=\"shrink-6\" />\n</span>\n```\n\n### TypeScript\n\nTypings are included in this package. However, most types are defined in the\nunderlying API library, `@fortawesome/fontawesome-svg-core`.\n\nSuppose that in one module, you add all `fas` icons to the library:\n\n```typescript\nimport { library } from '@fortawesome/fontawesome-svg-core'\nimport { fas } from '@fortawesome/free-solid-svg-icons'\n\nlibrary.add(fas)\n\n// ...\n```\n\nThen suppose that in another module, you have some code that looks up\none of the icons in the library. The `import` statement below imports two types\nand one function:\n\n```typescript\nimport {\n  IconLookup,\n  IconDefinition,\n  findIconDefinition\n} from '@fortawesome/fontawesome-svg-core'\n\nconst coffeeLookup: IconLookup = { prefix: 'fas', iconName: 'coffee' }\nconst coffeeIconDefinition: IconDefinition = findIconDefinition(coffeeLookup)\n\n// ...\n\nexport class App extends React.Component {\n  render() {\n    return (\n      <div className=\"App\">\n        <h1>\n          <FontAwesomeIcon icon={coffeeIconDefinition} />\n        </h1>\n      </div>\n    )\n  }\n}\n```\n\nNOTE: You wouldn't normally declare intermediate objects like `coffeeLookup`\njust to look up an icon. So this is cumbersome and needlessly verbose for such\na simple example. The purpose here is just to show how you might import type\ndefinitions and use them in declarations when it _does_ make sense to do so.\n\nSeveral types, including `IconLookup` and `IconDefinition`, appearing above,\nactually originate from the `@fortawesome/fontawesome-common-types` package.\nThey are re-exported from both `@fortawesome/fontawesome-svg-core` and\n`@fortawesome/free-solid-svg-icons` (and other icon packs). This is just to\nmake importing more convenient in some cases. Refer to the `index.d.ts` in any\nmodule to see which types it exports.\n","readmeFilename":"README.md","gitHead":"bdbe2570216db3d22e3c3e7d91c6f84c767e3c13","bugs":{"url":"https://github.com/FortAwesome/react-fontawesome/issues"},"_id":"@fortawesome/react-fontawesome@0.1.0-10","_npmVersion":"5.8.0","_nodeVersion":"8.9.1","_npmUser":{"name":"robmadole","email":"robmadole@gmail.com"},"dist":{"integrity":"sha512-twHx4heBADWVqcvcNgNessnpkuK67KVUB3q1WuuQrjzMZq24SXbu3FYPtk+rCvPu0QYB3Vc8ZfpW3QEkSoZRbg==","shasum":"e33c487b693db2ee03f4440081192a3eba4848e3","tarball":"http://registry-npm.ywwl.com/@fortawesome/react-fontawesome/download/@fortawesome/react-fontawesome-0.1.0-10.tgz","fileCount":7,"unpackedSize":42658,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6F/KCRA9TVsSAnZWagAAHT8QAI9ZWLmZfXTTn/Z2Ebh/\nfcHE6H36+K1JVo1I5ZcQ1my+aMNPfMYe/4e5ZhOrIiHichHNmKw2pnhFyIhC\nyF+JkkNRaqdD/NlLEfIkR+57MKiEWsa8PA4JbLPqSWXmS3gLXrNDthzoTPmW\n5U4Cx+naoHBbjNaGI66AmU7ULxWswsF+I57lFwOCtr+iKTOV4s8Q11I12/rZ\n/q+4q794HNbd/Idkpk045hdDAfalqpjxFJbAJ5mmiG3BAh4MFEUgUK/+mBrE\n1UsOwpLRgy75v8Okk+pGMGdnQvaqDBOzyGGBiGkYw7gaWDmeVJ8YmlAav+o6\n08cKLOtHPg/cgNfHOeURf/iaVG8ky9WFrjAlGrvyhz2tTbYiG/zfOhyAUI73\nklzgqWA8yxoA1OX6ClNqs8nqmGJVHPwdBhN+bbPWZXjRbRY/g/vloxTO6otn\nFLSFifV+XkslWC/lXPeVc8h84KvJ26Icsj/TNx2srzFh34MYVABJZoravTqE\n5JArUXZz+oP9OPA1nIIDAIarnwhPnJhn4BXbdoz9FAVSk9HBe8BGC6rLugA8\ntmaEWSFflVK2tuwuQ87Wq5rhqcsPX8TRHbigy8wgOKPgIS7ffrYFcTaSJ1cd\n+UT8PFKDQLLruO6ZAyYaPehDKHrDBD0/Xl2fXrVHN4my4K/QN90eGDJG6KQ6\nnVEq\r\n=Wq4/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMBOIhvL7INkb9/IQRxMN3KdstiLWG5GzFk/l1FZeafAIhAP9MjDCAGUgGpIGlRDgEnQX8kPbNqKxcJXnp6MxhTd4n"}],"size":12132,"noattachment":false,"key":"/@fortawesome/react-fontawesome/-/@fortawesome/react-fontawesome-0.1.0-10.tgz"},"maintainers":[{"email":"admin@fortawesome.com","name":"fortawesome-admin"},{"email":"mwilkerson@gmail.com","name":"mwilkerson"},{"email":"robmadole@gmail.com","name":"robmadole"},{"email":"travis@travischase.me","name":"supercodepoet"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-fontawesome_0.1.0-10_1525178314083_0.521878319373186"},"_hasShrinkwrap":false,"publish_time":1525178314258,"deprecated":"v0.1x is no longer supported. Please update to v3.1.1 or greater.","_cnpm_publish_time":1525178314258,"dist-tags":{"latest":"3.5.0","latest-0.1":"0.1.19","latest-0.2":"0.2.6"}}