View source: R/include_lottie.R
include_lottie | R Documentation |
Responsible for retrieving the 'Lottie' library and initialising the necessary 'JavaScript' library.
As such, this function must be included within the UI object of a shinyApp
in order to enable 'shinyLottie' functionality.
include_lottie(version = "5.12.2")
version |
A character string specifying the version of the 'Lottie' library to source via CDN. |
A list of HTML tags to be included within the head element of a 'shiny' application.
Calling this function initialises a global object "window.lottieInstances
" once the DOM content is fully loaded.
This is used to store the 'Lottie' animations that are created using lottie_animation
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.