Skip to content

Animating Icons

Our Styling Toolkit takes the trouble out of sizing, rotating, and stacking icons, so you can make your site pop with animations.

We’ll cover the basics of animations like beat, fade, beat-fade, flip, and spin to your icons, so that you can create more visual interest on your site.

Use the fa-beat animation to scale an icon up or down. This is useful for grabbing attention or for use with health/heart-centric icons.

<div class="fa-3x">
<i class="fa-solid fa-circle-plus fa-beat"></i>
<i class="fa-solid fa-heart fa-beat"></i>
<i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s;"></i>
<i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 2s;"></i>
<i class="fa-solid fa-heart fa-beat" style="--fa-beat-scale: 2.0;"></i>
</div>
UtilityDetails
--fa-beat-scaleSet max value that an icon will scale

Use the fa-fade animation to fade an icon in and out visually to grab attention in a subtle (or not so subtle) way.

<div class="fa-3x">
<i class="fa-solid fa-triangle-exclamation fa-fade"></i>
<i class="fa-solid fa-skull-crossbones fa-fade"></i>
<i class="fa-solid fa-desktop-arrow-down fa-fade"></i>
<i class="fa-solid fa-i-cursor fa-fade" style="--fa-animation-duration: 2s; --fa-fade-opacity: 0.6;"></i>
</div>
UtilityDetails
--fa-fade-opacitySet lowest opacity value an icon will fade to and from

Use the fa-beat-fade animation to grab attention by visually scaling and pulsing an icon in and out.

<div class="fa-3x">
<i class="fa-solid fa-triangle-person-digging fa-beat-fade"></i>
<i class="fa-solid fa-square-exclamation fa-beat-fade"></i>
<i class="fa-solid fa-poo-bolt fa-beat-fade" style="--fa-beat-fade-opacity: 0.1; --fa-beat-fade-scale: 1.25;"></i>
<i class="fa-solid fa-circle-info fa-beat-fade" style="--fa-beat-fade-opacity: 0.67; --fa-beat-fade-scale: 1.075;"></i>
</div>
UtilityDetails
--fa-beat-fade-opacitySet lowest opacity value an icon will fade to and from
--fa-beat-fade-scaleSet max value that an icon will scale

Use the fa-bounce animation to grab attention by visually bouncing an icon up and down.

<div class="fa-3x">
<i class="fa-solid fa-volleyball fa-bounce"></i>
<!-- bounce with extra rebound and "squish" on landing -->
<i class="fa-solid fa-basketball fa-bounce" style="--fa-bounce-land-scale-x: 1.2;--fa-bounce-land-scale-y: .8;--fa-bounce-rebound: 5px;"></i>
<!-- bounce animation with no "squish" -->
<i class="fa-solid fa-frog fa-bounce" style="--fa-bounce-start-scale-x: 1; --fa-bounce-start-scale-y: 1; --fa-bounce-jump-scale-x: 1; --fa-bounce-jump-scale-y: 1; --fa-bounce-land-scale-x: 1; --fa-bounce-land-scale-y: 1;"></i>
<!-- bounce animation with no "squish" or "rebound" -->
<i class="fa-solid fa-envelope fa-bounce" style="--fa-bounce-start-scale-x: 1;--fa-bounce-start-scale-y: 1;--fa-bounce-jump-scale-x: 1;--fa-bounce-jump-scale-y: 1;--fa-bounce-land-scale-x: 1;--fa-bounce-land-scale-y: 1;--fa-bounce-rebound: 0;"></i>
</div>
UtilityDetails
--fa-bounce-reboundSet the amount of rebound an icon has when landing after the jump
--fa-bounce-heightSet the max height an icon will jump to when bouncing
--fa-bounce-start-scale-xSet the icon’s horizontal distortion (“squish”) when starting to bounce
--fa-bounce-start-scale-ySet the icon’s vertical distortion (“squish”) when starting to bounce
--fa-bounce-jump-scale-xSet the icon’s horizontal distortion (“squish”) at the top of the jump
--fa-bounce-jump-scale-ySet the icon’s vertical distortion (“squish”) at the top of the jump
--fa-bounce-land-scale-xSet the icon’s horizontal distortion (“squish”) when landing after the jump
--fa-bounce-land-scale-ySet the icon’s vertical distortion (“squish”) when landing after the jump

Use the fa-flip animation to rotate an icon in 3D space. By default, flip rotates an icon about the Y axis 180 degrees. Flipping is helpful for transitions, processing states, or for using physical objects that one flips in the real world.

<div class="fa-3x">
<i class="fa-solid fa-compact-disc fa-flip"></i>
<i class="fa-solid fa-camera-rotate fa-flip"></i>
<i class="fa-solid fa-cassette-tape fa-flip"></i>
<i class="fa-solid fa-scroll fa-flip" style="--fa-flip-x: 1; --fa-flip-y: 0;"></i>
<i class="fa-solid fa-money-check-dollar fa-flip" style="--fa-animation-duration: 3s;"></i>
</div>
UtilityDetails
--fa-flip-xSet x-coordinate of the vector denoting the axis of rotation (between 0 and 1)
--fa-flip-ySet y-coordinate of the vector denoting the axis of rotation (between 0 and 1)
--fa-flip-zSet z-coordinate of the vector denoting the axis of rotation (between 0 and 1)
--fa-flip-angleSet rotation angle of flip. A positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one.

Use the fa-shake animation to grab attention or note that something is not allowed by shaking an icon back and forth.

<div class="fa-3x">
<i class="fa-solid fa-bell fa-shake"></i>
<i class="fa-solid fa-lock fa-shake"></i>
<i class="fa-solid fa-stopwatch fa-shake"></i>
<i class="fa-solid fa-bomb fa-shake"></i>
</div>

Use the fa-spin class to get any icon to rotate, and use fa-spin-pulse to have it rotate with eight steps. This works especially well with fa-spinner and everything in the spinner icons category. If you would like an icon to spin in reverse (e.g., counter-clockwise), add an additional class of fa-spin-reverse.

<div class="fa-3x">
<i class="fa-solid fa-sync fa-spin"></i>
<i class="fa-solid fa-circle-notch fa-spin"></i>
<i class="fa-solid fa-cog fa-spin"></i>
<i class="fa-solid fa-cog fa-spin fa-spin-reverse"></i>
<i class="fa-solid fa-spinner fa-spin-pulse"></i>
<i class="fa-solid fa-spinner fa-spin-pulse fa-spin-reverse"></i>
</div>
UtilityDetails
fa-spinMakes an icon spin 360° clockwise
fa-spin-pulseMakes an icon spin 360° clockwise in 8 incremental steps
fa-spin-reverseWhen used in conjunction with fa-spin or fa-spin-pulse, makes an icon spin counter-clockwise.

Using animations on the web in the most accessible way requires a little extra consideration:

In general, it’s best to use animations on the web in a complementary way rather than the only way to note a state change in UI. Remember to update the text of actions and change elements’ other visual aspects too!

And when it comes to an animation’s timing and duration, avoid changing the state of something at a rate of three times per second or greater - which can trigger photosensitive epilepsy.

All included animations now support and leverage the prefers-reduced-motion CSS media feature to detect if a user has requested that the system minimize the amount of non-essential motion it uses.

CaseHow It Affects Included Animations
No preference set (default)Animations will render as expected
Preference set to reduceAnimations will be disabled

When a prefers-reduced-motion is set to reduce, it indicates that the user prefers less motion, which may trigger discomfort for those with vestibular motion disorders on the page.

We’ve added CSS custom properties to make customizing easier and more efficient, and you can use these custom properties across all of our animations. Define your own values for the following properties to override and customize Font Awesome’s defaults.

CSS Custom PropertyDetailsAccepted Values
--fa-animation-delaySet an initial delay for animationAny valid CSS animation-delay value
--fa-animation-directionSet direction for animationAny valid CSS animation-direction value
--fa-animation-durationSet duration for animationAny valid CSS animation-duration value
--fa-animation-iteration-countSet number of iterations for animationAny valid CSS animation-iteration-count value
--fa-animation-timingSet how the animation progresses through framesAny valid CSS animation-timing-function value
<div class="fa-3x">
<i class="fa-solid fa-cog fa-spin"></i>
<i class="fa-solid fa-cog fa-spin" style="--fa-animation-direction: reverse;"></i>
<i class="fa-solid fa-cog fa-spin" style="--fa-animation-duration: 15s;"></i>
<i class="fa-solid fa-compact-disc fa-spin" style="--fa-animation-duration: 30s; --fa-animation-iteration-count: 1;"></i>
<i class="fa-solid fa-tire fa-spin" style="--fa-animation-duration: 3s; --fa-animation-iteration-count: 5;--fa-animation-timing: ease-in-out;"></i>
</div>

We’ve worked hard to keep icons perfectly centered when they spin or pulse. However, we’ve seen issues with several browsers with the Web Fonts + CSS method of Font Awesome. This appears to be an issue with web fonts in general and not something we can directly fix. We do have a couple of ways you might be able to work around this:

  • Set the display of the animating icon — Use display: block; where you can. This seems to help a lot with this issue.
  • Use multiples of 16px (the base font size) — We’ve noticed the wobble is more noticeable otherwise.
  • Switch Frameworks — Switch to the SVG with JavaScript method; it’s working a lot better for this.

Older versions of animate.css also used the fast CSS class selector to control the speed of animations.

Since Font Awesome also uses this class selector, they conflict with each other.

You can fix this by upgrading animate.css to a new version or you can add this exception into your CSS somewhere to work around the issues.

.animated.fast {
font-family: inherit;
}

Currently, some icons may become visually cut off in Safari when animated. This is a known issue that only occurs when all of the following are true:

  • An icon’s height leverages more than 16 grid units of our Icon Canvas - including some of Pro+ Icon Packs sadly.
  • An icon is rendered in Safari. All other modern browsers are not affected.
  • An icon is animated using one of our official animations

We’re working on a fix! In the meantime there is a work around you can manually apply using custom CSS.

<style>
/*custom rule */
.fa-fix-animation-for-safari::before {
/* add a bit more block-level padding to stop animating icon from being cropped in Safari */
padding-block: 0.1em;
}
</style>
<!-- affected icon without manual workaround -->
<i class="fa-solid fa-file-slash fa-bounce"></i>
<!-- affected icon with manual workaround (triggered by .fa-fix-animation-for-safari) -->
<i class="fa-solid fa-file-slash fa-bounce fa-fix-animation-for-safari"></i>