npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jayming/expo-svga-player

v1.0.2

Published

A expo svga player

Downloads

94

Readme

@jayming/expo-svga-player

Lightweight Expo / React Native wrapper for SVGA animations (Android, iOS, Web).

This repository contains a small native module exposing a SvgaPlayer view component with a unified API across platforms.

Installation

Install the package in your project (example uses pnpm in the repository root for the example app):

# Using npm
npm install @jayming/expo-svga-player

# Using pnpm
pnpm add @jayming/expo-svga-player

If you are developing with a bare React Native project, ensure expo packages are configured (see Expo docs). For iOS, run:

npx pod-install

Usage (React / React Native)

Simple example:

import SvgaPlayer from "@jayming/expo-svga-player";

// In JSX
<SvgaPlayer
  source="https://example.com/anim.svga"
  autoPlay={true}
  loops={0} // 0 means infinite in the JS API
  clearsAfterStop={true}
  align="center" // "top" | "center" | "bottom"
  style={{ width: 320, height: 420 }}
  onLoaded={() => console.log("loaded")}
  onFinished={() => console.log("finished")}
/>;

You can call startAnimation() / stopAnimation() using a ref to the view.

Platform notes & gotchas

  • Loops semantics:

    • On JS side loops is a number where 0 means infinite looping. Android native SVGA implementations sometimes treat 0 specially, so the Android bridge maps 0 to a very large repeat count to emulate infinite looping.
  • Align behavior (vertical alignment):

    • align accepts "top" | "center" | "bottom" and maps to platform-appropriate alignment.
    • Web: the container uses flexbox justify-content mapping so the canvas aligns vertically.
    • Android: align maps to ImageView.ScaleType plus enabling adjustViewBounds and requesting a layout pass to better reflect top/center/bottom. If you still see horizontal alignment, the parent layout may enforce constraints — try adjusting parent sizing or use a fixed height on the player view.
  • Threading / playback start:

    • Native parsing may run on background threads; the module ensures UI operations (setting the video item and starting playback) are posted to the UI thread to avoid silent failures.

Debugging

  • If animation does not appear on Android:
    1. Confirm onLoaded event fires (the component emits onLoaded when parsing completes).
    2. Check adb logcat for logs containing SvgaPlayerView or SVGA.

Example logcat filter:

adb logcat | grep SvgaPlayerView

Example app

The example/ folder contains a small React Native app demonstrating usage and runtime controls for loops, align, and manual URL input. Run it from the example directory:

cd example
pnpm install
pnpm android

Contributing

Contributions welcome — please open issues or PRs. Keep changes focused and include platform-specific testing steps when touching native code.

License

See the project root for license information.