Start an animation of the UI element.

startAnim(session, id, type = NULL, delay = NULL)

Arguments

session

The session object passed to function given to shinyServer.

id

the id of the UI element for which you want to add animation.

type

The type of animation to use, valid values correspond to the types in https://daneden.github.io/animate.css/

delay

The time after which you want to add animationin milliseconds

See also

Examples

if(interactive()){
library(shiny)
library(shinyanimate)
ui <- fluidPage(
 withAnim(),
 tags$div(id = 'title', h1('ANIMATION')),
 actionButton(inputId = "button", label = "Animate")
)
server <- function(input, output, session){
 observeEvent(input$button,{
   startAnim(session, 'title', 'bounce')
 })
}
shinyApp(ui, server)
}