/react-fontawesome-icon

An easy way to include FontAwesome icons in your React applications without having to add each icon separately.

Primary LanguageJavaScript

react-fontawesome-icon

An easy way to include FontAwesome (v6.4.0) icons in your React applications without having to add each icon separately.

npm npm npm bundle size JavaScript Style Guide

Install

npm i --save @honeybee-js/react-fontawesome-icon
yarn add @honeybee-js/react-fontawesome-icon

Usage

/**
 * FontAwesomeIcon
 * @param {string} icon (required) - icon to use. (e.g. 'chevron-right')
 * @param {string} lib - library to use. - (e.g. fas, far, fab) - default: fas
 * @param {reference} innerRef - you can still assign to ref
 * @param {...styledSystemProps} [color, layout, position, space, typography]
 * @param {...any} props
 *
 * @returns component
 *
 * @fontawesome docs - https://fontawesome.com/search
 * @styledSystem docs - https://styled-system.com/table
 */
import { FontAwesomeIcon } from "@honeybee-js/react-fontawesome-icon"
<FontAwesomeIcon icon="..." lib="..." ...styledSystemProps />
/* Example */
<FontAwesomeIcon icon="facebook-f" lib="fab" color="#3b5998" fontSize="20px" />

License

MIT © Samline