Frame Control with Sprite Sheets
When you need play / pause / goToFrame, an animated WebP
<img> won't cut it — it loops natively but can't pause mid-animation
or jump to a specific frame. mason-sprite drives each cell via
requestAnimationFrame, so you can sync playback with app state, pause on
interaction, or transition between animation sequences.
Also lighter — same WebP format
Sprite sheet source
The 49 KB file is a single 2 × 5 grid image — mason-sprite reads each cell as a frame and plays them in order.
55% smaller — saves 61 KB for the same 10-frame loop
import { MasonSprite } from 'mason-sprite/react';
<MasonSprite
src="/assets/img-cat-run-sprite.webp"
rows={2}
cols={5}
fps={10}
loop
width="8rem"
height="8rem"
/>