Animations
Boxicons comes with a set of pre-built CSS animations that let you add motion to your icons with simple utility classes. Animations are useful for drawing attention to actions, indicating loading states, or adding subtle feedback to your UI.
Enable Animations
To use the animation utilities, you first need to include the animations stylesheet in the <head> of your page:
animations.min.css
<link href="https://cdn.boxicons.com/animations.min.css" rel="stylesheet">Basic Animations
You can apply an animation to an icon by adding one of the animation classes directly to it.
Available animation classes
bx-spinbx-tadabx-flashingbx-burstbx-fade-leftbx-fade-rightbx-fade-upbx-fade-downbx-breathebx-beatbx-wigglebx-bounce
<i class="bxf bx-thumb-up bx-spin"></i>
<i class="bxf bx-thumb-up bx-tada"></i>
<i class="bxf bx-thumb-up bx-bounce"></i>These animations run continuously by default.
On Hover Animation
If you only want the animation to play when the user hovers over the icon, use the -hover variants of the animation classes.
Hover animation classes
bx-spin-hoverbx-tada-hoverbx-flashing-hoverbx-burst-hoverbx-fade-left-hoverbx-fade-right-hoverbx-fade-up-hoverbx-fade-down-hoverbx-breathe-hoverbx-beat-hoverbx-wiggle-hoverbx-bounce-hover
<i class="bxf bx-thumb-up bx-spin-hover"></i>
<i class="bxf bx-thumb-up bx-tada-hover"></i>
<i class="bxf bx-thumb-up bx-bounce-hover"></i>Controlling Animation Speed and Repetition
Because these are pure CSS animations, you can fully control them using standard CSS properties:
animation-duration— controls how fast or slow the animation runsanimation-iteration-count— controls how many times the animation repeats
<i
class="bxf bx-thumb-up bx-spin"
style="animation-duration: 2s; animation-iteration-count: 1;"
></i>