Lottie
Lottie
Compile Pax scenes to Lottie JSON, validate, repair, optimize, and preview animations locally with the paxfx CLI and @pax-sh/lottie.
Pax compiles supported scene subsets to Lottie JSON, then validates, repairs, optimizes, and previews them. The pipeline is deterministic and local. Pax does not claim full After Effects feature parity.
Installation
From monorepo source
git clone https://github.com/pax-design/pax.git
cd pax
corepack enable
pnpm install
pnpm buildUsage
Create a reproducible example, convert a scene, and preview the output:
pnpm paxfx create lottie logo
pnpm paxfx lottie convert examples/logo/scene.json
pnpm paxfx lottie validate examples/logo/animation.json
pnpm paxfx lottie preview examples/logo/animation.jsonThe convert step writes a sibling .lottie.json file next to your scene. Validation returns structured issues with paths and severities.
Examples
Shape and transform keyframes
pnpm paxfx create lottie logo
pnpm paxfx lottie inspect examples/logo/animation.jsonThe compiler supports shape and text layers, with opacity keyframes compiled from scene tracks.
Text strategy
Text layers compile to Lottie type 5 layers. Font strategy follows the scene specification. Unsupported font features are not claimed.
Markers
Compiled animations include a complete marker at the out-point, which QA tooling uses to detect the end of playback.
Optimize and repair pipeline
pnpm paxfx lottie repair examples/logo/animation.json
pnpm paxfx lottie optimize examples/logo/animation.jsonRepair applies high-confidence fixes in place. Optimize reports byte size before and after compaction.
Compatibility
| Feature | Status |
|---|---|
| Shapes and fills | Supported |
| Transforms and opacity keyframes | Supported |
| Text strategy | Supported (subset) |
| Markers | Supported |
| Expressions | Not claimed |
| 3D cameras and lights | Not in Lottie compiler |
| Arbitrary AE effects | Not claimed |
API Reference
CLI commands
All commands accept global flags: --json, --verbose, --quiet, --no-color, --ci, --cwd.
paxfx create lottie [name]type: command · default: loading
Scaffold a reproducible example with scene.json and animation.json under examples/[name]/.
paxfx lottie validate <file>type: command
Validate Lottie JSON structure, dimensions, frame rate, layer timing, and layer presence.
paxfx lottie inspect <file>type: command
Print summary metadata: name, width, height, frame rate, frame count, and layer count.
paxfx lottie repair <file>type: command
Apply high-confidence repairs in place. Review changes before committing.
paxfx lottie optimize <file>type: command
Compact animation JSON and report byte size before and after optimization.
paxfx lottie preview <file>type: command
Write a local HTML preview shell under .pax/scenes/lottie-preview.html with reduced-motion
fallback.
paxfx lottie convert <scene.json>type: command
Compile a validated Pax scene to Lottie JSON beside the source scene file.
@pax-sh/lottie library
Import from the workspace package after build.
compileSceneToLottie(scene)type: (scene: PaxScene) => LottieAnimation
Compile a supported Pax Scene subset into Lottie JSON.
validateLottie(input)type: (input: unknown) => { ok: boolean; issues: LottieIssue[] }
Schema and structural validation with path-qualified issues.
repairLottie(animation)type: (animation: LottieAnimation) => RepairReport
Repair high-confidence structural issues and return change list.
optimizeLottie(animation)type: (animation: LottieAnimation) => OptimizeReport
Optimize animation payload size deterministically.
packDotLottie / unpackDotLottietype: functions
dotLottie packaging helpers for interactive bundles. See dotLottie.
Scene layer fields
Lottie compilation reads these scene fields today.
layers[].typetype: "shape" | "text" | ...
Only shape and text layers compile to Lottie. Other layer types are skipped.
tracks[]type: Track[]
Opacity keyframes on opacity property compile to Lottie animated opacity when present.
timing.fpstype: number
Frame rate for compiled animation (fr).
timing.durationMstype: number
Duration used to compute out-point (op).
Was this page helpful?
Answers are not recorded or transmitted. Pax has no telemetry.