Download the PHP package karnoweb/lottie without Composer
On this page you can find all versions of the php package karnoweb/lottie. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download karnoweb/lottie
More information about karnoweb/lottie
Files in karnoweb/lottie
Package lottie
Short Description Karnoweb Lottie is a production-ready Laravel package for rendering Lottie animations.
License MIT
Informations about the package lottie
Karnoweb Lottie
Karnoweb Lottie is a production-ready Laravel package for rendering Lottie animations with:
- Lazy loading / viewport triggers
- Accessibility-friendly markup (
aria-label/aria-hidden) - Livewire
wire:navigatesupport - Memory-safe lifecycle (
destroy()cleanup)
Requirements
- Laravel: 11, 12 or 13
- PHP: 8.3+ This package is compatible with Laravel 11/12/13 service provider + Blade component conventions.
Installation
-
Add to your Laravel app (Composer):
-
Publish configuration:
This will create
config/lottie.php. -
Publish JS runtime assets:
The Blade component loads
resources/js/index.jsas an ES module from:public/vendor/karnoweb/lottie/ - No need to install
lottie-webin the host project
Karnoweb Lottie bundles lottie-web into its published JS runtime during package build, so the host project does not need to install lottie-web via npm.
Just run the publish steps above after updating the package.
"orsrc="animations/your-animation.json"`.
Usage
Basic
With controls
Attributes / Props
Required:
src(string): animation JSON source
Trigger system (trigger):
lazy(default)visiblehoverclickmanual
Playback options:
autoplay(boolean)loop(boolean)once(boolean)speed(number; > 0)direction(normalorreverse)
Layout / stability:
width(int|string|null)height(int|string|null)
Accessibility:
aria-label(string|null)- If provided: uses
aria-label="..." - If not provided: sets
aria-hidden="true"
- If provided: uses
Manual trigger
For trigger="manual", the animation starts when you dispatch a DOM event on the same element:
Livewire support
The package listens for livewire:navigated and refreshes instances after DOM replacement.
So it works with:
wire:navigate
Triggers behavior (current implementation)
lazy/visible: IntersectionObserver decides when to load/playhover:mouseentertriggers load/playclick: first click triggers load/playmanual: waits forlottie:manualcustom event
Testing
PHP (Pest)
From karnoweb/lottie/:
JS (Node test runner)
Notes / Assumptions
- JS runtime is loaded from published assets under
public/vendor/karnoweb/lottie/. - If you don’t run the
vendor:publish --tag=karnoweb-lottie-assetsstep, animations won’t initialize.