Learn R Programming

shinyLottie

The ‘shinyLottie’ package allows users to easily integrate and control ‘Lottie’ animations within ‘shiny’ applications, without the need for idiosyncratic expression or use of ‘JavaScript’. This includes utilities for generating animation instances, controlling playback, manipulating animation properties, and more.

Installation

You can install the development version of ‘shinyLottie’ from GitHub with:

# install.packages("devtools")
devtools::install_github("CamHowitt/shinyLottie")

Example

Introducing ‘Lottie’ animations to a ‘shiny’ app can be accomplished using just two ‘shinyLottie’ functions:

library(shiny)
library(shinyLottie)

ui <- fluidPage(
  include_lottie(),
  lottie_animation(
    path = "shinyLottie/example.json",
    name = "my_animation"
  )
)

server <- function(input, output, session) {}

shinyApp(ui, server)

For more advanced implementations, please refer to the following articles:

  • vignette("shinyLottie")

  • vignette("Controlling-Animations")

  • vignette("Event-Listeners")

Copy Link

Version

Install

install.packages('shinyLottie')

Monthly Downloads

126

Version

1.0.0

License

MIT + file LICENSE

Maintainer

Cameron Howitt

Last Published

June 21st, 2024

Functions in shinyLottie (1.0.0)

lottie_destroy

Destroy a 'Lottie' Animation
lottie_playSegments

Play Specific Segments of a 'Lottie' Animation
lottie_callMethod

Call a 'Lottie' Method
lottie_animation_methods

'Lottie' Animation Methods
lottie_addEventListener

Add Event Listener to 'Lottie' Animation
lottie_navigate_frame

Navigate to a Specific Animation Frame
lottie_animation

Generate 'Lottie' Animation for a 'shiny' application
lottie_button

Convert a 'Lottie' Animation to a Button
include_lottie

Include 'Lottie' Functionality within 'shiny'
lottie_getProperty

Get a Property of a 'Lottie' Animation
lottie_playback_controls

Control Playback of 'Lottie' Animations
lottie_removeEventListener

Remove Event Listener from 'Lottie' Animation
lottie_setDirection

Adjust 'Lottie' Animation Direction
lottie_setSpeed

Adjust 'Lottie' Animation Speed
lottie_setSubframe

Set 'Lottie' Animation Subframe Rendering
lottie_setLoop

Adjust 'Lottie' Animation Looping