PPTX

Animations

Add entrance, exit, emphasis, and motion path animations to shapes

Add animation effects to shapes to control how they appear and behave during a presentation.

Basic Usage

Animations are set directly on shapes via the animation property:

import { Shape } from "@office-open/pptx";

new Shape({
    x: 1,
    y: 1,
    width: 6,
    height: 3,
    text: "Animated shape",
    animation: {
        type: "fade",
        duration: 800,
    },
});

Animation Types

Entrance Animations (class: "entr", default)

TypeDescriptionSupported Directions
appearInstantly appear
fadeFade in
flyFly in from edgeleft, right, up, down
wipeWipe in from edgeleft, right, up, down
dissolveDissolve in
splitSplit inhorizontal, vertical
blindsBlinds effecthorizontal, vertical
checkerCheckerboardhorizontal, vertical
randomBarsRandom barshorizontal, vertical
wheelWheel spokes
zoomZoom in
coverCover from edgeleft, right, up, down
pushPush from edgeleft, right, up, down
stripsStrips from cornerleft, right, up, down

Exit Animations (class: "exit")

Same types as entrance, but with class: "exit":

animation: { type: "fade", class: "exit", duration: 800 }
animation: { type: "fly", class: "exit", direction: "right" }

Emphasis Animations (class: "emph")

emphasisTypeDescription
growShrinkScale up then back
spinFull rotation
colorChangeChange color (requires color)
transparencyFade to semi-transparent
boldFlashBold text flash
waveWave effect
pulsePulse effect
growWithTurnGrow with rotation
animation: { class: "emph", emphasisType: "growShrink", duration: 800 }
animation: { class: "emph", emphasisType: "spin", duration: 1000 }
animation: { class: "emph", emphasisType: "colorChange", color: "FF0000" }

Motion Path Animations

pathTypeDescription
lineStraight line
arcArc curve
circleCircular path
curveS-curve
figureEightFigure-eight
bounceBounce path
loopLoop path
customPathCustom SVG path (requires path)
animation: { pathType: "circle", duration: 1500 }
animation: { pathType: "customPath", path: "M 0 0 L 100 0 L 100 100 L 0 100 Z", duration: 1200 }

Animation Options

PropertyTypeDefaultDescription
typeAnimationType"appear"Animation preset type
class"entr" | "exit" | "emph""entr"Animation category
durationnumber500Duration in milliseconds
delaynumber0Delay before start in milliseconds
triggerAnimationTrigger"onClick"How animation is triggered
directionAnimationDirectionDirection of the animation
emphasisTypeEmphasisTypeEmphasis animation type (class="emph")
pathTypePathAnimationTypeMotion path type
pathstringCustom SVG path string
speednumberSpeed multiplier
repeatCountnumberNumber of repetitions
autoReversebooleanfalseAuto-reverse after completion
colorstringTarget color for colorChange

Trigger Modes

// Click to trigger (default)
animation: { type: "fade", trigger: "onClick" }

// Trigger with previous animation
animation: { type: "fade", trigger: "withPrevious" }

// Trigger after previous animation completes
animation: { type: "fade", trigger: "afterPrevious" }
Copyright © 2026