Font Awesome has a ton of great styling tools that work hand-in-hand with our icons to make your project look its best.

Advertisement

The entire Font Awesome styling toolkit is available when using React, but the syntax is different from our general web-use documentation. Below you'll find the syntax for adding styling with React, with links to the general documentation which has descriptions and examples for each styling tool.

Size

Font Awesome supports t-shirt size scale from 2xs to 2xl as well as literal sizing from 1x to 10x.

/* T-shirt sizes */
<FontAwesomeIcon icon="fa-solid fa-coffee" size="xs" />
<FontAwesomeIcon icon="fa-solid fa-coffee" size="lg" />

/* X-factor sizing */
<FontAwesomeIcon icon="fa-solid fa-coffee" size="6x" />
Remember, you can always control icon size directly with the CSS `font-size` attribute. The `FontAwesomeIcon`'s size prop determines icon size relative to the current context's font-size.

Fixed-width

Setting icons to use a fixed-width helps when you're trying to align icons in a vertical column.

<FontAwesomeIcon icon="fa-solid fa-coffee" fixedWidth />

Icons in a List

<FontAwesomeIcon icon="fa-solid fa-coffee" listItem />
Advertisement

Rotate and Flip Icons

Rotate on quarter turns and flip horizontally, vertically, or both. Or try power transforms for more granularity.

/* Rotate */
<FontAwesomeIcon icon="fa-solid fa-coffee" rotation={90} />
<FontAwesomeIcon icon="fa-solid fa-coffee" rotation={180} />
<FontAwesomeIcon icon="fa-solid fa-coffee" rotation={270} />

/* Flip */
<FontAwesomeIcon icon="fa-solid fa-coffee" flip="horizontal" />
<FontAwesomeIcon icon="fa-solid fa-coffee" flip="vertical" />
<FontAwesomeIcon icon="fa-solid fa-coffee" flip="both" />

Animate Icons

You can use the animate utilities as a way to indicate loading or processing, especially when paired with icons like spinner or sync. The spin utility smoothly spins the icon clockwise, and the pulse utility spins clockwise in eight steps.

<FontAwesomeIcon icon="fa-solid fa-cog" spin />
<FontAwesomeIcon icon="fa-solid fa-spinner" pulse />

We've also built a some animation utilities into CSS custom properties.

Bordered Icons

Add a border around an icon with this utility.

<FontAwesomeIcon icon="fa-solid fa-coffee" border />
Advertisement

Pulled Icons

Wrap text around an icon with this utility.

<FontAwesomeIcon icon="fa-solid fa-coffee" pull="left" />
<FontAwesomeIcon icon="fa-solid fa-coffee" pull="right" />

Power Transforms

Power Transforms are just that - powerful! You can scale, position, rotate, and flip all with this one styling tool.

  • To scale icons up or down, use grow-# and shrink-# with any arbitrary value, including decimals.
  • To move icons up, down, left, or right, use up-#, down-#, left-#, and right-# with any arbitrary value, including decimals.
  • To rotate or flip icons use any combination of flip-v, flip-h, or rotate-# with any arbitrary value.
/* Use basic utilites */
<FontAwesomeIcon icon="fa-solid fa-coffee" transform="shrink-6 left-4" />

/* Or computed */
<FontAwesomeIcon icon="fa-solid fa-coffee" transform={{ rotate: 42 }} />

Mask

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.

<FontAwesomeIcon icon="fa-solid fa-coffee" mask="fa-regular fa-circle" />
Advertisement

Duotone Icons

For Duotone icons, you can swap the opacity on the layers:

<FontAwesomeIcon icon="fa-duotone fa-coffee" swapOpacity />

We've also built a lot of utility into CSS custom properties for Duotone icons.

Use SVG Symbols

<FontAwesomeIcon icon="fa-solid fa-coffee" symbol />
<FontAwesomeIcon icon="fa-solid fa-coffee" symbol="beverage-icon" />

Layer

You can use the layering utilities to layer icons, text, or add counters. You can also invert an icon to get a cut-out effect.

Layer Icons

Layer one or more icons to create a new icon. Include fixed-width to have the layers align.

<span className="fa-layers fa-fw fa-lg">
  <FontAwesomeIcon icon="fa-solid fa-circle" />
  <FontAwesomeIcon icon="fa-solid fa-check" transform="shrink-6" inverse />
</span>

Invert the Icon Color to White

This can be useful when layering icons, or on its own.

<FontAwesomeIcon icon="fa-solid fa-coffee" inverse />

Add Your Own CSS Classes

You can add classes for your own project purposes and styling to any component using the className property.

<FontAwesomeIcon icon="fa-solid fa-spinner" className="highlight" />

Did you know?

We have an fa-truck load of CSS custom properties to let you customize and style your icons even more.

You're viewing the Version 6 Beta

It's all the awesome of 5, but now more six-y! Version 6 brings over 13,000 icons across 5 styles – including the new Thin style! – and includes more and faster services.

Get the Deets on Version 6

Head Back to Our Current Version 5 Release

Need a Hand?

If you’re stuck or have a question, check our Troubleshooting docs, all of the Font Awesome threads on Stack Overflow, or contact our community on GitHub.

Or get Real Human Support™ with a Pro Subscription!