PHP code example of visualbuilder / filament-lottie

1. Go to this page and download the library: Download visualbuilder/filament-lottie library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

visualbuilder / filament-lottie example snippets


use Visualbuilder\Lottie\LottiePlugin;

->plugins([
    LottiePlugin::make()
        ->defaultSize('80px')
        ->defaultRespectReducedMotion(true),
])

use Visualbuilder\Lottie\Components\Lottie;

Lottie::make('welcome')
    ->src('lottie/welcome.lottie')
    ->autoplay()                 // default true
    ->loop(false)                // default false (play once)
    ->speed(1.0)
    ->size('120px')              // shorthand → width + height
    ->trigger('mount')           // mount | click | hover | visible | event:NAME
    ->onComplete('event:NAME')   // dispatch a window event when animation finishes
    ->respectReducedMotion();    // default true
bash
php artisan vendor:publish --tag=lottie-config
blade
<x-lottie src="lottie/welcome.lottie" autoplay :loop="false" size="120px" />