Animations for Blocks


Lightweight plugin that adds additional inspector controls to block editor blocks that allow to animate the block once it becomes visible to the user during scrolling. The controls can be used to select an animation type (fade, flip, slide, zoom), variation (different directions), as well as delay, duration and more advanced settings. Upon changing an option the animation can be immediately previewed in the editor.


This plugin uses AOS – Animate on scroll library and adds its’ stylesheet (2.8 kB) and script (5.2 kB) to the front end as well as a script that initializes the animations (1.3 kB).


  • Adding an animation
  • Animation controls


Install via admin dashboard

  1. Go to your WordPress admin dashboard -> Plugins.
  2. Click “Add New”.
  3. Click “Upload Plugin”.
  4. Select the file.
  5. Click “Install Now”.
  6. Activate the plugin from WordPress admin dashboard -> Plugins.

Manual install via FTP upload

  1. Upload the folder “animations-for-blocks” from file to your WordPress installations ../wp-content/plugins folder.
  2. Activate the plugin from WordPress admin dashboard -> Plugins.


How do I add an animation?

In your selected block’s inspector controls (block settings) open the “Animation” panel and select an animation. The current block should display a preview of the selected animation and further options related to that animation will become available below.

How does it work?

Animations for Blocks plugin works by using the Animate on Scroll (AOS) library that is mostly CSS based with some JavaScript to handle initialization. The plugin adds attributes to block’s root element that tell the AOS library how to animate it. Loading the necessary styles and scripts is also handled automatically by the plugin.

Does it work for all blocks?

It should work with normal blocks that render a valid WP Element that can utilize the blocks.getSaveContent.extraProps filter as well as dynamic blocks that utilize a render_callback. Third party blocks that do something unorthodox may not work.
Known unsupported blocks

Disable block support

The anfb_unsupported_blocks filter can be used in your child theme’s functions.php file to disable block animation support.

add_filter('anfb_unsupported_blocks', function($blocks) {
    $blocks[] = 'core/button';
    return $blocks;

What happens when I disable this plugin?

After disabling this plugin blocks with animations can become invalid. From there you can attempt to recover the block by clicking “Attempt Block Recovery” which should remove the custom animation attributes. If you don’t want to risk blocks becoming invalid you need to disable all animations before disabling the plugin.

All the animated elements are invisible on the front end

When none of the animated elements show up on your site it’s possibly due to a JavaScript error preventing the initialization of AOS. Please open the Developer Tools (F12 on Chrome/Firefox) and look for any errors in the Console tab. You can contact support with the error message, include your site link if possible.


30, Payares de 2022
I'm a bit of an "old school" developer and have been struggling to fully embrace Gutenberg/Block Editor. I'm building a new Block Editor base theme for use on my client projects, and I wanted to include AOS. I was preparing to add the library directly in my plugin and trying to figure out how I would ever get it to seamlessly integrate into the Block Editor interface… and then I found this plugin! It is perfect. It includes all of the AOS parameters, works on virtually any block (even nested blocks), and most important to me, it looks like it belongs in the Block Editor. Speaking as a plugin developer as well, I can't stand plugins that try to imprint their own UI elements all over WordPress. If you're adding something to WordPress, make it look like WordPress. Anything else is at best distracting, and at worst, confusing to end users. This one is perfect. I won't spend another second trying to integrate AOS directly into my theme… I'll just install this plugin on any site that needs animation! Very well done, and I hope the user base grows so the devs can continue to support it.
25, Payares de 2022
I have used several plugins that offer animation blocks or similar. This one is the most straight forward Animate On Scroll wrapper for wordpress blocks.
Read all 12 reviews

Contributors & Developers

“Animations for Blocks” is open source software. The following people have contributed to this plugin.


“Animations for Blocks” has been translated into 1 locale. Thank you to the translators for their contributions.

Translate “Animations for Blocks” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



  • Add option to disable automatic animation preview.
  • Add option to lazyload assets when an animated block is preset on the current page.
  • Update @wordpress/* packages.
  • Update screenshots.


  • Use WP_HTML_Tag_Processor for adding HTML attributes.
  • Blocks that render multiple root elements are no longer wrapped automatically. Use Animation container block to do it.
  • Move all PHP code to main file for simplicity.


  • Animation preview works in iframe-d block editors.
  • Rework controls.
  • Add ability to copy-paste animation settings.
  • Update Animation container block to API version 2.
  • Use render_block filter to apply animation attributes instead of overriding block’s render_callback.
  • Add anfb_aos_attributes filter that can modify attributes that are added to animated HTML elements.
  • Convert some code to typescript.
  • Update @wordpress/* packages.
  • Test with WordPress 6.2-RC1.


  • Fix once and mirror options detection in dynamic blocks.
  • Update @wordpress/* packages.
  • Test with WordPress 6.1.1.


  • Update @wordpress/* packages.
  • Test with WordPress 6.0.
  • Add GitHub link.
  • Remove src folder from plugin.


  • Update block anchor selector.


  • Use generated version number for AOS library.


  • Fix encoding for dynamic blocks.


  • Add more unsupported blocks.
  • Move Animation Container block to “Design” category.


  • Initial release.