ui-lottie icon indicating copy to clipboard operation
ui-lottie copied to clipboard

Svelte integration?

Open soundsystems opened this issue 3 years ago • 2 comments
trafficstars

is it possible to integrate in s svelte native app?

soundsystems avatar Feb 10 '22 20:02 soundsystems

sure you just need to register the element following svelte-native doc (on my phone right now)

farfromrefug avatar Feb 10 '22 21:02 farfromrefug

Hello This is how you can make it work in svelte - native , it worked with :

import { registerNativeViewElement } from "svelte-native/dom";
registerNativeViewElement(
  "LottieView",
  () => require("@nativescript-community/ui-lottie").LottieView
);

Add it to your root APP.ts

Then you can directly use it in any .Svelte file in your project as this

  <stackLayout>
        <lottieView
          src="loading.json"
          height="100"
          loop="true"
          autoPlay="true"
          loaded="yourLoadedEvent"
        />
      </stackLayout>

rakanus avatar Oct 03 '22 15:10 rakanus