Skip to main content

Quickstart

This guide will walk you through creating your first Helios composition from scratch. In about 10 minutes, you’ll have a working animated video.
We’ll build a simple canvas animation that you can preview in your browser and render to MP4. This example uses vanilla JavaScript, but Helios works with React, Vue, Svelte, and other frameworks.

What we’re building

A 5-second animation featuring:
  • A circle moving across the screen
  • A rotating square in the center
  • Smooth, frame-perfect playback

Setup your project

1

Create a new project directory

2

Install dependencies

This installs:
  • @helios-project/core - The animation engine
  • @helios-project/player - Preview player
  • vite - Development server and bundler
3

Create project files

Create the following file structure:

Create your composition

HTML entry point

Create index.html:

Composition logic

Create src/main.ts:

Understanding the code

Let’s break down what’s happening:
1

Initialize Helios

This creates a Helios instance that manages the animation timeline.
2

Bind to document timeline

This connects Helios to the browser’s native animation system, allowing the player and renderer to control playback.
3

Subscribe to frame updates

Every time Helios updates (play, pause, seek), your draw function is called with the current frame number.
4

Calculate progress

Convert the current frame to a 0-1 progress value. This makes it easy to animate properties smoothly.
5

Expose to window

The player and renderer look for window.helios to control your composition.

Preview your composition

1

Add dev script to package.json

2

Start the dev server

Open your browser to http://localhost:5173. You should see your animation!
3

Test the preview controls

Open your browser console and try:

Add the player component

For a better preview experience with UI controls, use the Helios Player:
1

Create a player HTML file

Create preview.html:
2

Preview with player controls

Navigate to http://localhost:5173/preview.htmlYou now have:
  • Play/pause button
  • Seek bar
  • Frame counter
  • Export options
The player loads your composition in a sandboxed iframe, providing isolation and standard HTMLMediaElement controls.

Render to video

Now let’s render your composition to an MP4 file.
1

Install the renderer

2

Create a render script

Create render.ts:
3

Update package.json scripts

4

Install tsx for running TypeScript

5

Render your video

This will:
  1. Build your composition with Vite
  2. Launch headless Chrome
  3. Capture each frame
  4. Encode to MP4 with FFmpeg
Your video will be saved as output.mp4!
Make sure your composition is built before rendering. The renderer needs the bundled files, not source files.

Using animation helpers

Helios includes powerful animation utilities. Let’s enhance our composition:

Available helpers

Next steps

Explore examples

Check out 80+ examples in the GitHub repository covering:
  • GSAP animations
  • Three.js 3D scenes
  • Chart.js visualizations
  • Lottie animations
  • Framer Motion
  • And more

Learn the API

Dive deeper into Helios capabilities:
  • Audio tracks and mixing
  • Captions and subtitles
  • Input props and schemas
  • Timeline markers
  • Distributed rendering

Framework integration

Use Helios with your preferred framework:
  • React with useVideoFrame() hook
  • Vue with composables
  • Svelte with stores
  • Solid.js integration

Production rendering

Deploy Helios for scale:
  • Docker containerization
  • AWS Lambda distributed rendering
  • Google Cloud Run
  • Local orchestrator for parallel rendering

Troubleshooting

Canvas is blank

Make sure you:
  1. Resize the canvas to match the window
  2. Clear the canvas before drawing
  3. Subscribe to Helios state updates

Animation doesn’t update

Verify that:
  1. helios.bindToDocumentTimeline() is called
  2. window.helios is exposed
  3. You’re calling helios.play() or seeking manually

Render produces black frames

Check that:
  1. Your composition is built (npm run build)
  2. The composition URL is correct (use file:// protocol)
  3. The canvas has proper dimensions

TypeScript errors

Add type declarations:

Tips for success

1

Start simple

Begin with basic shapes and movements. Add complexity gradually.
2

Use progress values

Convert frames to 0-1 progress for easier math:
3

Preview often

The dev server provides instant feedback. Use it liberally.
4

Expose to window

Always export window.helios so the player and renderer can control your composition.
5

Test different frame rates

30fps is standard, but try 60fps for smoother motion or 24fps for a cinematic feel.
Congratulations! You’ve created your first Helios video. The same patterns you learned here scale to complex, production-ready compositions.