Log in Request my site

Animate a block

This article explains how to add an animation to a block, choose its effect, its trigger and its pace, then chain several animations. You will also learn how to import your own animations and make one block react to another.

Before you start

  • Animations are set in the Animations tab of the sidebar, when a block is selected.
  • Most blocks have this tab. The table, the logo, the PDF, the embed, the table of contents, the navigation menu and its links, the search, and the filters and pagination of a list do not. Animate the container around them instead.
  • Animations do not play in the editor. To see them, open the page on your Staging.
  • A visitor who asks for less motion sees your blocks with no animation, in their final state.

Add an animation

  1. Select the block and open the Animations tab.
  2. Click Add animation. A card is added to the list and opens.
  3. Open the Effect menu, which shows Choose an effect…, then choose an effect. Each effect is described in the menu.
  4. Choose the Trigger, then the Behavior.
  5. Set the Timing function, the Duration (ms) and the Delay (ms), then the options specific to the effect.
The Animations tab of the number 12: card 1. Count up and its When visible badge, the Count up effect, the When visible trigger and the Fires setting on Once it has entered.

Each animation is shown as a one-line summary, for example 1. Count up, with a badge that says when it starts. Only one card is open at a time. The trash can Remove animation deletes it.

A block can carry several animations, but the same effect appears only once: an effect already in use leaves the menu of the other cards. Two motion effects on the same block can work against each other. Prefer a single, short motion effect per block.

Choose an effect

The Effect menu sorts effects into three groups: Text effects, Block effects and Custom.

The text effects
EffectResult
CircleA circle drawn by hand around the content.
UnderlineAn underline drawn by hand under the content.
BoxA box drawn by hand around the text.
HighlightA marker highlight that follows line breaks.
Strike throughA line drawn by hand across the text.
Crossed offA cross drawn by hand over the text.
BracketsBrackets drawn by hand around the text.
Enlarge textThe font weight increases, word after word.
Swap wordsThe words of the block, separated by a comma and a space, replace one another.
Split textThe text appears word after word, or character after character.
Type textThe text is written letter after letter, on a keyboard or by hand.
Count upThe number of the block climbs from zero. A screen reader always announces the real number.
The block effects
EffectResult
SlideThe block slides in from a chosen direction.
Fade inThe block fades in.
Zoom inThe block grows to its place.
3D flipThe block enters by pivoting around the vertical axis.
ExpandThe block is revealed through a shape that grows.
Ken BurnsA slow zoom and pan, on an image.
ShimmerA sweep of light passes over the block.
Gradient borderA gradient outline turns around the block.
ScaleThe block changes size between two values.
3D TiltThe block tilts in 3D toward the pointer.
ShiftThe block moves slightly with the pointer, over its parent block.
MagneticThe block drifts toward the pointer.
Spread siblingsPlaced on a container, it spreads the other children away from the one the pointer is over.
Stagger childrenThe block’s direct children, or its words, animate one after another.
Waved borderA wavy outline drawn by hand.
DrawThe strokes of an icon or an SVG are drawn from start to end.
ParallaxThe block moves at a different speed during scrolling.
Fit to a blockThe block tightens onto another block during scrolling.

Custom @keyframes, the only effect of the Custom group, plays an animation that you import: see the section “Import an animation”. Parallax and Fit to a block are described in Animate on scroll.

The motion of an animated icon is chosen with the icon. An Icon gesture entry then appears in the list. It is set like the other animations.

Choose when the animation starts

The Trigger menu is displayed when the effect leaves a choice. Otherwise, the only possible trigger is shown under the effect.

The triggers
TriggerStart of the animation
When visibleWhen the block comes into view while scrolling.
On hoverWhen the pointer passes over the block.
On clickWhen the visitor clicks the block.
When activatedWhen the block becomes active: the tab or slide displayed, or a block that another one activates.
On scrollThe animation advances at the pace of scrolling. See Animate on scroll.

3D Tilt, Shift, Magnetic and Spread siblings start only On hover.

Set the moment the block is visible

With When visible, the Fires setting says how far the block must have entered the screen. Each choice is a line on the screen, which the top of the block must reach.

The choices of Fires
ChoicesStart
As soon as it appearsAs soon as the top of the block enters from the bottom of the screen. For a large section.
Once it has enteredWhen the top of the block is 80 px from the bottom of the screen. Default value.
Well into viewWhen the top of the block reaches about two thirds of the screen. For a counter or a hand-drawn stroke.
At a set heightWhen the top of the block reaches the height set with the slider, from 10 to 90% of the screen from the top. The slider opens at 50.

At the very bottom of a page, a block cannot always rise to its line. Its animation then starts when the page reaches the end.

Animate on click

A click on the block activates the block and a second click deactivates it. The Behavior decides what follows.

On click, by behavior
BehaviorEffect of the click
Play onceThe first click plays the animation, which stays in its final state.
ReplayOne click plays the animation, the next rewinds it, the third replays it.

Choose the behavior

The behaviors
BehaviorEffect
Play onceThe animation plays once and stays in its final state, even if the block becomes active again. Default value.
ReplayThe animation replays on every entry into view, every hover or every activation.
InfiniteThe animation loops as long as the block is active. Offered for effects that form a cycle: Ken Burns, Gradient border, Shimmer, Custom @keyframes, Stagger children, Count up, Swap words, Draw and Scale with the Pulse option.

The Behavior setting is not displayed on effects that follow the pointer.

Set the duration

The pace settings
SettingEffectDefault value
Timing functionThe curve of the movement: Ease in out, Ease in, Ease out, Linear or Custom (cubic-bezier).That of the effect
Duration (ms)The duration of the animation.That of the effect, for example 600 for Fade in and 1,000 for Underline
Delay (ms)The delay before the start.0

Some effects add a step: Stagger step (ms) for Stagger children and Split text, Letter step (ms) for Type text. The duration of Type text is that of its letters.

Chain several animations

An animation placed under another animation that ends can start with it or after it.

  1. Put the animations in the order you want with the Move up and Move down arrows of their summary.
  2. Open the card of the animation that follows.
  3. Under Start, choose With previous or After previous. On trigger lets it start on its own trigger.
Three animations on a heading: 1. Fade in with the When visible badge, 2. Underline with the With previous badge, 3. Highlight with the After previous badge, then the Add animation button.

When at least two animations precede it, the Follows setting chooses which one it follows. Two animations can thus start with the same first one. The summary then shows for example With no. 1.

An animation follows only an animation listed above it. An Infinite animation, an On scroll animation and Split text cannot be followed: they have no known end.

Set an effect’s options

Each effect adds its own settings under the pace. The following table gives the most common ones.

The options of a few effects
EffectOptions
SlideDirection, among eight, Up by default. Distance, 96 px by default. Fade, checked by default: the block fades in during the slide. Blur: the block sharpens from a slight blur.
ExpandShape: Horizontal, Vertical, Radial, Diamond, From top, From left or Lines.
ScaleScale from (1), Scale to (1.1) and Pulse, which returns to the starting value.
ShimmerDirection, Apply to (Whole block or Text only), Color and Band width.
Type textWriting: Keyboard, with a cursor, By hand, or Letters, with no cursor.
Split textSplit by: Word or Character.
Stagger childrenTargets (Direct children or Words), Arrangement, then the opacity, scale and starting and ending position.
Hand-drawn effectsColor, Weight and Visual variation, whose New variation button draws another stroke.

With no color chosen, a drawn effect is drawn in the block’s text color. Highlight takes your design system’s primary color.

Import an animation

The Custom @keyframes effect plays an animation written in CSS and kept in a library shared by the whole site.

  1. Choose the Custom @keyframes effect.
  2. Next to Animation library, click + (New animation).
  3. In the @keyframes CSS field, paste a @keyframes block.
  4. Click Save animation. It joins the library.
  • An animation contains a single @keyframes block, nothing before or after. The steps accepted are from, to and whole percentages from 0 to 100%.
  • Only transforms, opacity, colors, filters, clips, shadows and SVG stroke drawing are kept. Other properties are removed on import.
  • A tag, @import, @media, @supports or url() causes the import to be refused.
  • Editing an animation while keeping its name updates all the blocks that use it. Changing its name creates an animation.

The pencil Edit animation reopens the source and the Delete button removes the animation from the library.

Activate another block at the end

The On finish, activate setting makes another block active when the animation ends. That block can then start its animations When activated. The list offers the blocks of the page that have an HTML anchor.

With Play once, the activated block stays active. With Replay or Infinite, it is released when the animation is removed.

Make other blocks react

The Interactions part of the Animations tab links a block to others.

The settings of the Interactions part
SettingEffect
Pass the active state to childrenWhen the block becomes active, its direct children become active too. They stop being active with it.
Add target blockChooses a block of the page by its anchor, the Source event (Click, Hover or When activated) and the Action on the target (Activate, Deactivate, Toggle or Click).
Synchronize child groupsPlaced on a parent, it makes the elements of the same rank in its lists of children advance together.

Each activated child does what you set for the active state: its colors in the Active state of the Styles tab, Hide this block to appear or disappear, or an animation When activated.

Example: the caption of a slide

The heading of each slide comes in in turn when it is displayed.

  1. Select a slide and turn on Pass the active state to children.
  2. Select the heading of its caption and add a Slide animation to it.
  3. Set its Trigger to When activated.

Each time the slide is displayed, its heading slides in.

Animate a transformed block

An animation is added to the settings of the Effects panel: a tilted card slides or zooms while staying tilted.

The settings of the Effects panel during an animation
SettingWith an animation
Rotation, Translate, Scale, SkewStay applied.
Opacity, Filter, Clip pathDo not combine with an entrance effect, which animates them itself. Set on the block, they take precedence and the effect no longer animates them: a fade on a block at 50% opacity does nothing. Set by a saved style, the effect takes precedence.

Respect visitors who are sensitive to motion

A visitor can ask for less motion in their device settings, or with a motion switcher placed on your site. For that visitor, three things change.

  • entrance animations display at once in their final state and a text written letter by letter displays in full;
  • nothing follows the pointer or the scroll and animated icons freeze;
  • a counter keeps the number you wrote, Swap words its first word and Scale the original size of the block.

The motion switcher is described in Appearance and motion switchers.

See also

Updated on

All documentation pages