Ultralight JS library to animate your DOM elements. You can find library documentation on


First function to call is always target function, which takes a selector, a DOM element or more DOM elements as input and return an object of functions. We can divide these functions into action functions, option functions and plugin functions. Every action, option or plugin function return the same object of functions, with a final function: animate, that plays the animation and return a promise (fulfilled at the and of the created animations). Click on `play` button at top left to play animations.

    const target ='div')

    // or:

    const element = document.querySelector('div')
    const target =

    target.duration(.8) // Option function.{ width: '200px' }) // Action function.

    target.list() // List plugin function.

    // Create the animation and wait for the end.
    await target.duration(.8).to({ width: '200px' }).animate()

Method chaining

As you can see Movigo use method chaining technique, and save the state of the animation in each function. This means that you can break the chain and create new chains with additional functions by building different animations.

    const slowAnimation = target.duration(1)

    await{ width: '100px' }).animate()
    await{ height: '100px' }).animate()


Action functions allow you to change CSS property values. There are currently two function: to and from. Both take an object containing CSS properties and they work like in a CSS keyframe: from values represent the initial state of the animation, to values represent the final state. If from function is not defined, the initial state is represented by the current CSS target properties. To see a full list of available actions you can also use movigo.actions() function.

    await target.duration(.3).to({
      width: '80px',
      height: '80px',
      borderRadius: '100%',
      transform: 'rotateZ(90deg) translateY(-100px)'


Option functions allow you to set some properties of the animations, such as duration, speed curve of the transition effect, delays or loops. The number parameter of delay and duration functions must be defined in seconds, easing function parameter values can be found in W3S documentation and loop function take a number of loops or nothing (infinite loop). To see a full list of available options you can use movigo.options() function.

    await target
            width: '80px',
            height: '80px',
            transform: 'rotateZ(180deg)'

    // Infinite loop:
    // target.loop().to({ left: '100px' }).animate()
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Specific parameters

Option and action functions can get a function as parameter, in which i-th element can be used to define specific element options or actions.

    const letters = document.querySelectorAll('span')
    const target =

    await target
        .delay((i, el) => i * .05).duration(.4)
        .easing('cubic-bezier(0.4, 0.0, 0.2, 1)')
        .to({ opacity: 1 }).animate()


You can create simple animations to make your UI more user-friendly with feedback.

    await target
        .easing('cubic-bezier(0.33, 1, 0.68, 1)')
        .to({ transform: 'scale(2, 2)', opacity: .3 })


You can create loading animations with a few lines of code.

    await target
        .delay(i => i * .1).duration(.4).loop(5)
        .to({ transform: 'scaleY(1.5)', opacity: .6 })

List plugin

List plugin allows you to create and manage animations for lists of elements, with slide-in and fade-in effects.

    const elements = document.querySelectorAll('ul > li')
    const target =

    await target.list().animate()


Focus plugin allows you to create animations to focus particular elements by scaling an element and obscuring the other background elements.

    const images = document.querySelectorAll('img')
    const target =

    await target.focus({
        element: 1 // Index of focused element.


Drawer plugin allows you to animate sidebars by creating a slide effect and obscuring the background container.

    const sidenav = document.querySelector('.sidenav')
    const container = document.querySelector('.container')
    const target =[sidenav, container])

    await target.drawer().animate()