Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Lottie Laravel Package

visualbuilder/filament-lottie

Add Lottie animations to Filament 5 panels via a schema component and a Blade component. Bundles @lottiefiles/dotlottie-wc, auto-registers assets (optional), supports defaults via config/plugin, and offers autoplay/loop/speed/size/triggers and reduced-motion support.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Schema Component Integration: Seamlessly integrates with Filament 5’s schema builder, enabling dynamic Lottie animations in admin panels (e.g., form fields, resource tables, or custom widgets). Leverages Filament’s component-based architecture without disrupting existing workflows.
  • Blade Component Flexibility: Provides a lightweight Blade directive (<x-lottie />) for non-schema contexts (e.g., marketing pages, dashboards), expanding use cases beyond admin panels.
  • Livewire 4 Compatibility: Built for Filament 5/Livewire 4, ensuring alignment with modern PHP/Laravel ecosystems (e.g., dependency injection, reactivity).

Integration Feasibility

  • Low Friction: Composer install + optional config publish (vendor:publish) suffices for basic usage. No database migrations or complex setup required.
  • Asset Management: Auto-registers JS/CSS globally (configurable via auto_register_assets). For performance-critical apps, manual asset registration is supported.
  • Dependency Isolation: Bundles @lottiefiles/dotlottie-wc (Web Components-based Lottie player) via npm, avoiding conflicts with existing frontend tooling (e.g., Vite, Webpack).

Technical Risk

  • Frontend Dependency: Relies on @lottiefiles/dotlottie-wc (vulnerability patched in 5.0.0-beta.2). Risk mitigated by:
    • Explicit version pinning in composer.json.
    • Clear upgrade path (e.g., npm update @lottiefiles/dotlottie-wc).
  • Performance Overhead: Lottie animations add ~50–200KB per asset (depending on complexity). Mitigation:
    • Lazy-load assets via trigger('visible') or load-on-request.
    • Compress Lottie files pre-build (e.g., using lottie-optimizer).
  • Reduced Motion: Respects prefers-reduced-motion by default, but custom triggers (e.g., event:NAME) may bypass this. Requires UX testing for accessibility compliance.

Key Questions

  1. Asset Hosting:
    • Will Lottie files be hosted on CDN (recommended for performance) or bundled with the app?
    • How will versioning/hashed filenames be managed for cache invalidation?
  2. Trigger Strategy:
    • Are animations primarily for visual feedback (e.g., mount) or interactive states (e.g., click)? This dictates trigger selection.
  3. Fallbacks:
    • Should static fallbacks (e.g., GIFs or SVG placeholders) be implemented for unsupported browsers?
  4. Monitoring:
    • How will animation playback errors (e.g., failed JSON parsing) be logged/handled?
  5. Scalability:
    • For apps with >100 Lottie assets, will the auto-registered JS/CSS approach impact initial load time?

Integration Approach

Stack Fit

  • Backend: Native PHP/Laravel integration via Filament’s plugin system. No backend logic required beyond asset paths.
  • Frontend:
    • Filament Panels: Schema components render server-side, with Lottie assets loaded dynamically via dotlottie-wc.
    • Blade Views: Directives compile to <lottie-player> Web Components, compatible with modern SPAs (e.g., Inertia.js) or static sites.
    • Tooling: Works alongside Vite/Webpack if assets are manually registered (via auto_register_assets = false).

Migration Path

  1. Assessment Phase:
    • Audit existing Filament schemas/Blade templates for animation use cases.
    • Identify Lottie assets (or source them from tools like After Effects or LottieFiles).
  2. Pilot Integration:
    • Install package and test in a non-production Filament panel (e.g., a custom widget).
    • Validate schema component rendering and Blade directive compilation.
  3. Rollout:
    • Schema Components: Replace static images/GIFs with Lottie::make() in resource forms/tables.
    • Blade Views: Replace <img> tags with <x-lottie /> in marketing pages.
    • Asset Optimization: Run Lottie files through optimization tools and host on CDN.
  4. Configuration:
    • Publish config (vendor:publish --tag=lottie-config) to set global defaults (e.g., default_size, respect_reduced_motion).
    • Override defaults per panel using LottiePlugin::make().

Compatibility

  • Filament 5/Livewire 4: Primary target; no known conflicts.
  • Legacy Systems:
    • Filament 4: Use visualbuilder/filament-lottie:4.x branch.
    • Non-Livewire: Blade component works standalone but loses schema integration benefits.
  • Browser Support: dotlottie-wc supports modern browsers (Chrome 55+, Firefox 60+, Safari 11+). Test fallbacks for older browsers if needed.

Sequencing

  1. Phase 1: Schema Components
    • Replace static visuals in Filament forms/tables with Lottie::make().
    • Example: Add a welcome animation to the create view of a Page resource.
  2. Phase 2: Blade Integration
    • Embed animations in non-admin pages (e.g., landing pages, onboarding flows).
  3. Phase 3: Optimization
    • Implement lazy loading, CDN hosting, and error monitoring.
  4. Phase 4: Advanced Triggers
    • Use event:NAME triggers for custom interactions (e.g., "play on form submission").

Operational Impact

Maintenance

  • Package Updates:
    • Monitor visualbuilder/filament-lottie for Filament 5 compatibility updates.
    • Rebuild frontend assets (npm run build) if @lottiefiles/dotlottie-wc major versions are updated.
  • Asset Management:
    • Track Lottie file versions (e.g., welcome-v2.lottie) to avoid cache conflicts.
    • Document asset paths in a docs/animations.md file for developer handoffs.
  • Configuration Drift:
    • Centralize defaults in config/lottie.php to avoid per-panel inconsistencies.

Support

  • Debugging:
    • Schema Issues: Check Filament’s resources/views/vendor/filament/... for rendered output.
    • Blade Issues: Inspect compiled assets in browser dev tools (<x-lottie><lottie-player>).
    • Animation Errors: Use onComplete to log events or implement a global error handler for dotlottie-wc.
  • Common Pitfalls:
    • CORS: Ensure Lottie assets are served with correct headers if hosted externally.
    • Pathing: Use absolute paths (e.g., /lottie/welcome.lottie) or mix()/vite() helpers for local assets.
    • Reduced Motion: Test with prefers-reduced-motion: reduce in browser dev tools.

Scaling

  • Performance:
    • Asset Loading: Use trigger('visible') for offscreen animations or implement Intersection Observer.
    • Bundle Size: Exclude unused Lottie files from auto-registered assets (e.g., split into separate JS chunks).
    • CDN: Offload assets to a CDN (e.g., Cloudflare R2, AWS S3) with long cache TTLs.
  • Team Scaling:
    • Design Handoff: Provide designers with Lottie file specs (e.g., max size, loop behavior).
    • Developer Onboarding: Document component API in a README.md within the Filament panel codebase.

Failure Modes

Failure Scenario Impact Mitigation
Lottie file 404 Broken animation placeholder Use onError callback or static fallback (e.g., SVG).
JS/CSS auto-registration conflict Rendering issues in Filament panels Disable auto-register and manually include assets in resources/js/app.js.
dotlottie-wc version mismatch Animations not playing Pin @lottiefiles/dotlottie-wc version in package.json.
Reduced motion override Accessibility violations Enforce respectReducedMotion(true) globally and test with prefers-reduced-motion.
Large asset bundle Slow initial load Lazy-load assets or split into micro-bundles per panel.

Ramp-Up

  • Developer Training:
    • 15-min Workshop: Demo schema component usage and Blade directive syntax.
    • Cheat Sheet: Provide examples for common use cases (e.g., "Add a loading animation to a form").
  • Design Collaboration:
    • Work with designers to standardize Lottie file formats (e
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity