Skip to main content
Helios drives the browser’s native animation engine rather than reimplementing animation in JavaScript. This means your existing CSS animations, WAAPI timelines, and animation libraries work out of the box.

CSS animations

Standard CSS @keyframes animations work natively with Helios when autoSyncAnimations is enabled.

Basic CSS animation

With autoSyncAnimations: true, Helios automatically:
  1. Discovers all CSS animations via document.getAnimations()
  2. Sets animation.currentTime to match the timeline
  3. Pauses animations to prevent drift
See packages/core/src/drivers/DomDriver.ts:372 for the WAAPI sync implementation.

Animation timing

CSS animation duration maps directly to composition time:
At 30fps:
  • Frame 0: Animation at 0% (start state)
  • Frame 45: Animation at 50% (1.5 seconds)
  • Frame 90: Animation at 100% (end state)

Animation delay

Animation won’t start until 1 second into the composition (frame 30 at 30fps).

Multiple animations

All animations are synchronized to the same timeline.

Web Animations API (WAAPI)

The Web Animations API provides programmatic animation control while still using the browser’s rendering engine.

Creating WAAPI animations

Manual WAAPI control

Without autoSyncAnimations, you can manually control WAAPI animations:

Shadow DOM support

Helios automatically discovers animations in Shadow DOM when using DomDriver:
The DomDriver scans shadow roots automatically (see DomDriver.ts:120).

Animation libraries

Helios works with popular animation libraries that use WAAPI under the hood or provide time-based APIs.

GSAP

See examples/gsap-animation/ for a complete example.

Framer Motion

With Helios’s React adapter:
See examples/framer-motion-animation/ for details.

Motion One

See examples/motion-one-animation/.

Lottie

See examples/lottie-animation/.

Animation helpers

Helios provides utility functions for common animation patterns.

Interpolate

Map input values to output values with easing:
Full interpolate API at packages/core/src/animation.ts:20:

Spring

Physics-based spring animations:
Spring configurations:
See animation.ts:136 for physics implementation.

Calculate spring duration

Sequencing

Coordinate animations across time.

Sequence helper

Sequence returns:
See packages/core/src/sequencing.ts:20 for implementation.

Series helper

Place items sequentially:

Stagger helper

Stagger animations by a fixed interval:

Canvas and procedural animation

For canvas-based compositions, you control the render loop:
See examples/p5-canvas-animation/ and examples/pixi-canvas-animation/ for library integrations.

Easing functions

Helios provides common easing functions:
See packages/core/src/easing.ts for the full list.

Best practices

Prefer CSS for simple animations

Use will-change for better performance

This hints to the browser to optimize for animation.

Avoid layout thrashing

Use hardware-accelerated properties

Prefer transform and opacity over layout-affecting properties:

Next steps