@fortawesome/react-fontawesome
- Version 3.0.0
- Published
- 63 kB
- 1 dependency
- MIT license
Install
npm i @fortawesome/react-fontawesome
yarn add @fortawesome/react-fontawesome
pnpm add @fortawesome/react-fontawesome
Overview
Official React component for Font Awesome
Index
Variables
variable FontAwesomeIcon
const FontAwesomeIcon: React.ForwardRefExoticComponent<any>;
FontAwesomeIcon component.
Interfaces
interface AnimationProps
interface AnimationProps {}
property beat
beat?: boolean | undefined;
Makes the icon scale in and out continuously.
See Also
property beatFade
beatFade?: boolean | undefined;
property bounce
bounce?: boolean | undefined;
Makes the icon bounce up and down.
See Also
property fade
fade?: boolean | undefined;
Makes the icon fade in and out continuously.
See Also
property pulse
pulse?: boolean | undefined;
See Also
Deprecated
Will be removed in a future version. Please use spinPulse instead.
Makes the icon spin 360deg clockwise in 8 incremental steps.
property shake
shake?: boolean | undefined;
Makes the icon shake.
See Also
property spin
spin?: boolean | undefined;
Makes the icon spin 360deg clockwise continuously.
See Also
property spinPulse
spinPulse?: boolean | undefined;
Makes the icon spin 360deg clockwise in 8 incremental steps.
See Also
property spinReverse
spinReverse?: boolean | undefined;
interface FontAwesomeIconProps
interface FontAwesomeIconProps extends AnimationProps, TransformProps, Omit<SVGAttributes<SVGSVGElement>, 'children' | 'mask' | 'transform'>, RefAttributes<SVGSVGElement> {}
property border
border?: boolean | undefined;
Applies a border to the icon
See Also
property className
className?: string | undefined;
Any additional CSS classes to apply to the icon
property color
color?: string | undefined;
The color of the icon. Can be any valid CSS color value
property fixedWidth
fixedWidth?: boolean | undefined;
See Also
Deprecated
7.0.0
Starting in FontAwesome 7.0.0, all icons are fixed width by default. This property will be removed in a future version.
If you want to remove the fixed width to replicate the behavior of previous versions, you can set the new widthAuto property to
true
.
property icon
icon: IconProp;
The icon to render.
See Also
property inverse
inverse?: boolean | undefined;
Invert the icon color.
See Also
property mask
mask?: IconProp | undefined;
Grab the Mask utility when you want to layer two icons but have the inner icon cut out from the icon below so the parent element’s background shows through.
See Also
property maskId
maskId?: string | undefined;
Accessibility ID for the mask element
property size
size?: SizeProp | undefined;
The size of the icon from a predefined set of sizes.
property style
style?: (CSSProperties & CSSVariables) | undefined;
Any custom styles or CSS variable overrides for the icon element.
property swapOpacity
swapOpacity?: boolean | undefined;
When using Duotone icons, this property will swap the opacity of the two colors. The first color will be rendered with the opacity of the second color, and vice versa
See Also
property tabIndex
tabIndex?: number | undefined;
property title
title?: string | undefined;
An accessibility title for the icon to be read by screen-readers or assistive technologies.
property titleId
titleId?: string | undefined;
A unique ID for the accessibility title element.
property widthAuto
widthAuto?: boolean | undefined;
When set to
true
, the icon will automatically adjust its width to only the interior symbol and not the entire Icon Canvas.See Also
interface TransformProps
interface TransformProps {}
property flip
flip?: FlipProp | boolean | undefined;
Flip the icon horizontally, vertically or both.
property listItem
listItem?: boolean | undefined;
Example 1
<ul className='fa-ul'><li><span className='fa-li'><FontAwesomeIcon icon={['fas', 'check']} /></span>List item with icon</li></ul>See Also
Deprecated
Simply wrap the icon instead, no need to pass this property.
property pull
pull?: PullProp | undefined;
Wrap text around the icon by pulling it left or right.
property rotateBy
rotateBy?: boolean | undefined;
Custom rotation is used to rotate the icon by a specific number of degrees, rather than the standard 90, 180, or 270 degrees available in the
rotation
property.To use this feature, set
rotateBy
totrue
and provide a CSS variable--fa-rotate-angle
with the desired rotation angle in degrees.Example 1
<FontAwesomeIconicon="fa-solid fa-coffee"rotateBystyle={{ '--fa-rotate-angle': '329deg' }}/>See Also
property rotation
rotation?: RotateProp | undefined;
The rotation property is used to rotate the icon by 90, 180, or 270 degrees.
See Also
property symbol
symbol?: FaSymbol | undefined;
The icon should render as an SVG symbol rather than a regular element.
See Also
property transform
transform?: string | Transform | undefined;
Apply a custom transform to the icon either using the built-in Transform config, or a CSS transform string.
See Also
Package Files (1)
Dependencies (1)
Dev Dependencies (46)
- @babel/core
- @babel/plugin-external-helpers
- @babel/preset-env
- @babel/preset-react
- @babel/preset-typescript
- @eslint/js
- @fortawesome/fontawesome-svg-core
- @fortawesome/free-brands-svg-icons
- @fortawesome/free-solid-svg-icons
- @semantic-release/changelog
- @semantic-release/git
- @testing-library/dom
- @testing-library/jest-dom
- @testing-library/react
- @types/jest
- @types/react
- @types/react-dom
- @types/semver
- browserslist
- caniuse-lite
- cross-env
- eslint
- eslint-config-prettier
- eslint-plugin-import
- eslint-plugin-jest
- eslint-plugin-jsx-a11y
- eslint-plugin-prettier
- eslint-plugin-react
- eslint-plugin-react-hooks
- eslint-plugin-testing-library
- eslint-plugin-unicorn
- globals
- husky
- jest
- jest-environment-jsdom
- prettier
- pretty-quick
- react
- react-dom
- rimraf
- semantic-release
- ts-jest
- ts-node
- tsup
- typescript
- typescript-eslint
Peer Dependencies (2)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@fortawesome/react-fontawesome
.
- Markdown[](https://www.jsdocs.io/package/@fortawesome/react-fontawesome)
- HTML<a href="https://www.jsdocs.io/package/@fortawesome/react-fontawesome"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3781 ms. - Missing or incorrect documentation? Open an issue for this package.