animateAppend: Append animation to a Shiny element

Description Usage Arguments Details Value Examples

View source: R/font_awesome_animate.R

Description

Append animation to a Shiny element

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
animateAppend(element, animation, speed = NULL, hover = FALSE)

animateAppendNested(
  element,
  animation,
  speed = NULL,
  hover = FALSE,
  display = "inline-block",
  ...
)

Arguments

element

the shiny element to append, must have "shiny.tag" class for animateAppend and can be either "shiny.tag" or "shiny.tag.list" for animateAppendNested.

animation

what kind of animation you want, one of "wrench", "ring", "horizontal", "horizontal-reverse", "vertical", "flash", "bounce", "bounce-reverse", "spin", "spin-reverse", "float", "pulse", "shake", "tada", "passing", "passing-reverse", "burst", "falling", "falling-reverse", "rising"s See our online demo for details.

speed

string, one of "fast", "slow"

hover

bool, trigger animation on hover?

display

string, CSS display method for the out-most wrapper, one of the v alid css display method, like "block", "inline", "flex", default is "inline-block".

...

other attributes add to the wrapper, for animateAppendNested only

Details

animateAppend

Append the animation directly to the element you provide, but can only apply one type of animation

animateAppendNested

Append multiple animations to the element you provide by creating a wrapper around the element. Animations are applied on the wrappers. This may cause some unknown issues, especially on the display property. Try change the display may fix the issues. It is safer to use animateAppend.

Read more about CSS display: https://www.w3schools.com/cssref/pr_class_display.asp

Value

returns a Shiny element

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
if (interactive()){
  library(shiny)

  ui <- fluidPage(
    icon("home") %>%
      animateAppend("ring"),
    h2("Append animation", class = "text-primary") %>%
      animateAppend("pulse"),
    br(),
    h2("Nested animations", class = "text-primary") %>%
      animateAppendNested("ring") %>%
      animateAppendNested("pulse") %>%
      animateAppendNested("passing"),
    tags$span("Other things"),
    h2("Nested animations display changed", class = "text-primary") %>%
      animateAppendNested("ring") %>%
      animateAppendNested("pulse", display = "block", style = "width: 30%"),
    tags$span("Other things")
  )

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

  }

  shinyApp(ui, server)
}

spsComps documentation built on Feb. 3, 2022, 1:07 a.m.