Skip to content

v0.9.2 • Motion • 12kb gzipped • MIT

SpriteJS

A tiny sprite engine for canvas, with atlas packing and a frame loop that keeps its promises.

★ 5.0kGitHub
↓ 6.1k / week● MIT● TS 5.0+
spritejs-preview.png
Abstract preview graphic for SpriteJS

// why spritejs

A frame loop you can trust

Fixed-step updates with interpolated rendering, so behaviour stays identical whether the display runs at 60 or 144 hertz.

● 60fps● 2ms frame cost● 0 deps

// stack

Atlas-aware

Packs sprite sheets at build time and looks frames up by name at runtime. No manual coordinate tables.

SpriteJS started as a single file in a client project and stayed small on purpose. It does one job, it does it in 12kb gzipped, and it has no runtime dependencies.

Getting started

Install it, import it, call it:

npm i spritejs-js

Fixed-step updates with interpolated rendering, so behaviour stays identical whether the display runs at 60 or 144 hertz.

What it does not do

It does not manage your state, style your components or ship a plugin system. Those are your decisions, and keeping them out is what keeps the bundle honest.

  • Fixed-step updates
  • Named atlas frames
  • MIT licensed, commercially friendly

Features

Fixed-step updates

Physics and animation stay deterministic regardless of refresh rate or a slow frame.

Named atlas frames

Reference frames by name; the packer resolves coordinates during the build.

Compositor friendly

Animates transform and opacity only, so nothing triggers layout.

Fully controllable

Play, pause, reverse and seek, all from a plain object.

Respects reduced motion

Reads the user preference and falls back to an instant state change.

ESM and types

Ships module and CommonJS builds with hand-written type definitions and source maps.

Get SpriteJS v0.9.2

8 files • .min.js 12kb • .zip 55kb • sha384 verified

Changelog

v0.9.2 Jun 3 2026 • latest
  • Fixed-step loop with interpolation
  • Atlas packer handles rotation
  • Batched draw calls
v0.9.1 Apr 18 2026
  • Safari 16 compatibility fixes
  • Bundle size reduced by eleven percent
v0.9 Feb 16 2026
  • Improved error messages for invalid options
  • Added twenty regression tests
View full archive →

// related

Related products

Sep 10 • v2.0

ChartForge

Canvas charts in twelve lines. Responsive, accessible and dark-mode ready, with no D3 learning curve.

View →
Aug 30 • v3.2.1

MotionEase

Physics-based micro-animations with a single call. Spring curves that feel right without a tuning session.

View →
Aug 19 • v1.9.4

FormFlow

Validation and multi-step logic that works the same in React, Vue and vanilla. Your markup stays yours.

View →

Make it move today.

MIT licensed. Commercial friendly. Five-minute setup.