Search by

pushinbr / pam-native-lottie

DavidWilliamBalbino

Native Lottie animations for PAM Native: lottie-android and lottie-ios behind one host view, paused off-screen, with a bounded composition cache.

Package info

github.com/push-in/pam-native-lottie

Documentation

Language:Kotlin

Type:pam-native-plugin

pkg:composer/pushinbr/pam-native-lottie

Statistics

Installs: 52

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.1 2026-11-18 01:13 UTC

This package is auto-updated.

Last update: 2026-11-18 04:03:05 UTC


README

pam-native-lottie: Native Lottie animations: one host view, paused off-screen, bounded composition cache.

Native Lottie (Bodymovin) animations for PAM Native, the equivalent of lottie-react-native.
lottie-android 6.6 and lottie-ios 4.5 behind one host view, lottie.view, driven from PHP or a template tag.

Packagist Latest release PHP 8.5 License

Install · Quick example · Platforms · Resources · Docs · Issues

Install

Inside a PAM Native project, add only this capability:

pam composer require pushinbr/pam-native-lottie
pam doctor --fix

The plugin registers the <Lottie> template tag and the lottie.view native view. New to PAM? Create a project with pam init my-app --template native (see the PAM Native overview).

Quick example

use Pam\Native\Lottie\Lottie;

Lottie::url('https://cdn.example.com/party/lottie.json')
    ->size(116)
    ->playing($visible)   // RN ref.resume() / ref.pause()
    ->fallback('🎉');

The same view as a template tag (registered by LottiePluginProvider):

<Lottie :uri="$emoji['lottieUrl']" size="116" :playing="$visible" fallback="🎉" label="Animated emoji" />
<Lottie src="assets/lottie/success.json" size="64" :loop="false" />

More: examples/EmojiTile.php (a picker tile that animates only the first rows) and the full method and attribute table in docs/lottie.md.

Platform support

Platform Support Notes
Android API 24+ lottie-android 6.6.0, RenderMode.HARDWARE
iOS 15.0+ lottie-ios 4.5 via lottie-spm, QuartzCore, UIKit
PAM Native 1.0.0 to < 2.0.0 From pam-native.plugin.json; PHP 8.5+

Permissions and requirements

No runtime permissions. Remote animations need network access; file:// and asset:// (app bundle / Android assets) sources work offline.

Resource rules

  • Frames only while the view is attached, visible and playing; reduced motion shows the first frame.
  • One process-wide composition cache (32 entries / 12 MiB, LRU, trimmed on memory pressure); concurrent requests for a URL share a single download; parsing off the main thread.
  • Android renders with RenderMode.HARDWARE (as renderMode="HARDWARE" in RN).
  • Animate only what is on screen: in grids, pass playing only for the first visible tiles.

Tests

pam composer test     # php tests/run.php

iOS checks (core harness, Simulator behavior): docs/ios-validation.md.

Docs

Part of the PAM ecosystem

PAM

PAM runs PHP natively on servers, desktops and phones. This repository is one piece of it.

PAM PAM Desktop PAM Native Ecosystem
the runtime and CLI native desktop apps in PHP native Android and iOS apps in PHP every official package and plugin

Docs: push-in.github.io/pam-docs · Issues

Apache License 2.0 · Made in Brazil by Pushin