lottie_button {shinyLottie} | R Documentation |
Convert a 'Lottie' Animation to a Button
Description
Wraps a 'Lottie' animation within a button element for use in 'shiny' applications.
Usage
lottie_button(
animation,
inputId,
label = NULL,
width = NULL,
height = NULL,
...
)
Arguments
animation |
A 'Lottie' animation created by |
inputId |
The 'shiny' |
label |
Optional text label to display below the animation inside the button. |
width |
Width of the button. This is validated using |
height |
Height of the button. This is validated using |
... |
Additional named attributes to pass to the button element. Same behaviour as |
Value
An HTML button element enclosing the animation
input object.
Examples
library(shiny)
library(shinyLottie)
ui <- fluidPage(
include_lottie(),
lottie_animation(
path = "shinyLottie/example.json",
name = "my_animation",
height = "100px",
width = "100px"
) |> lottie_button(inputId = "my_button")
)
server <- function(input, output, session) {
observeEvent(input$my_button, {
print("Button pressed")
})
}
shinyApp(ui, server)
[Package shinyLottie version 1.0.0 Index]