a-animation
AnimationElement
A simple interface to include Rive animations in html, as if it was just an image.
Example
Attributes
Name | Type | Default value | Description |
---|---|---|---|
artboard
|
string | undefined |
artboard name |
autoplay
|
boolean | undefined |
wether to autoplay on load |
height
|
number | undefined |
height in pixel |
layout
|
"cover" | "fill" | "contain" | undefined |
fit |
src
|
string | undefined |
url to .riv file |
stateMachine
|
string | undefined |
name of state machine |
width
|
number | undefined |
width in pixel |
Events
Name | Description |
---|---|
load
|
Emitted when animation has loaded. |
play
|
Emitted when animation has started playing. |
pause
|
Emitted when animation has been paused. |
Methods
AnimationElement.cleanup()
src/AnimationElement.ts:365
AnimationElement.text(name: string, text: string)
src/AnimationElement.ts:176
Get or set the text of a rive textrun by name
Examples
Different example confugrations of rive animations.
Doaload example riv