Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Svelte integration? #96

Open
soundsystems opened this issue Feb 10, 2022 · 2 comments
Open

Svelte integration? #96

soundsystems opened this issue Feb 10, 2022 · 2 comments

Comments

@soundsystems
Copy link

is it possible to integrate in s svelte native app?

@farfromrefug
Copy link
Member

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

@rakanus
Copy link

rakanus commented Oct 3, 2022

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants