Skip to content

Accessible scroll animations

An entrance is decorative motion. All content must work without it. Awesome Reveal never removes content from the page, and it shows the content immediately when the motion can cause a problem.

If the user asks for reduced motion, all the content shows immediately, with no animation and no delay:

  • In React, Vue and Astro, the stylesheet does not hide the content, and the package reveals each element when it attaches it.
  • In the JavaScript API, reveal() and cascade() create no animations.

If the preference changes to reduced motion while the page is open, core cancels the waiting and the running entrances, and the content shows. For reduced motion and when, see Hide the content. For onReveal and the reveal event with reduced motion, see Run code when the reveal starts.

To test, emulate prefers-reduced-motion in the developer tools of your browser.

Focus in a waiting element reveals it immediately, with no entrance. Thus a keyboard user does not focus invisible content. Focus in a waiting cascade container reveals all its children.

Focus during the delay or the entrance finishes the entrance immediately. In a cascade, focus in the container also finishes the entrances of the children that wait for their interval.

In React, Vue and Astro, server markup also shows while focus is in it, before the script attaches it. See The 5 second hold.

In React, Vue and Astro, focus does not reveal an element while when is false.

A waiting element stays in the accessibility tree, so screen readers read it, and the keyboard can focus its controls. Do not put information in the motion only.

To hide content from all users, see Hide the content.

Waiting content shows in print:

  • In React, Vue and Astro, the stylesheet hides content only on screens.
  • In the JavaScript API, core moves each waiting entrance to its end before the print. After the print, the entrance waits again.

Core uses the beforeprint and afterprint events. The print emulation in developer tools does not fire these events. To test the JavaScript API, open the print preview of your browser.