1.0.0-alpha.0 • Published 2 years ago

@nstudio/nativescript-rive v1.0.0-alpha.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

@nstudio/nativescript-rive

Rive for NativeScript

npm install @nstudio/nativescript-rive

Usage

For iOS, configure your nativescript.config.ts to use the Swift Package:

ios: {
SPMPackages: [
        {
            name: 'RiveRuntime',
            libs: ['RiveRuntime'],
            repositoryURL: 'https://github.com/rive-app/rive-ios.git',
            version: '3.1.8',
        },
    ],
},

Use RiveView:

<Page xmlns="http://schemas.nativescript.org/tns.xsd"
  xmlns:ui="@nstudio/nativescript-rive">
    <GridLayout>
        <ui:RiveView src="~/assets/rive/icons.riv" width="300" height="300" autoPlay="true"/>
    </GridLayout>
</Page>

Using State Machines

You can specify the artboard, stateMachine, input along with inputValue (boolean).

<ui:RiveView src="~/assets/rive/icons.riv" artboard="CHAT" stateMachine="CHAT_Interactivity" input="active" inputValue="{{inputValue}}" width="300" height="300" autoPlay="true"/>

License

Apache License Version 2.0