R/wa_animated_image.R

Defines functions wa_animated_image

Documented in wa_animated_image

# Generated by tools/generate_components.R. Do not edit by hand.
# nolint start: object_usage_linter.

#' Create a `wa-animated-image` component
#'
#' Generated wrapper for the Web Awesome `wa-animated-image` component.
#' Generated from Web Awesome metadata.
#'
#' @param ... Child content for the component's default slot.
#' @param id Optional DOM id attribute for HTML, CSS, and JS targeting.
#' @param class Optional CSS class string.
#' @param style Optional inline CSS style string.
#' @param alt String. A description of the image used by assistive
#' devices.
#' @param dir String. Optional Web Awesome attribute.
#' @param lang String. Optional Web Awesome attribute.
#' @param play Boolean. Default: `FALSE`. Plays the animation. When this
#' attribute is remove, the animation will pause.
#' @param src String. The path to the image to load.
#' @param pause_icon Optional pause icon to use instead of the default.
#' Works best with `<wa-icon>`.
#' @param play_icon Optional play icon to use instead of the default.
#' Works best with `<wa-icon>`.
#'
#' @section Shiny Bindings:
#' None.
#'
#' @return An HTML tag for the component.
#'
#' @export
wa_animated_image <- function(
  ...,
  id = NULL,
  class = NULL,
  style = NULL,
  alt = NULL,
  dir = NULL,
  lang = NULL,
  play = NULL,
  src = NULL,
  pause_icon = NULL,
  play_icon = NULL
) {
  children <- list(...)
  children <- c(
    children,
    list(
      .wa_slot(pause_icon, "pause-icon")
    )
  )
  children <- c(
    children,
    list(
      .wa_slot(play_icon, "play-icon")
    )
  )

  attrs <- .wa_normalize_attrs(
    list(
      "id" = id,
      "class" = class,
      "style" = style,
      "alt" = alt,
      "dir" = dir,
      "lang" = lang,
      "play" = play,
      "src" = src
    ),
    boolean_names = c("play"),
    boolean_arg_names = c("play" = "play")
  )

  do.call(
    .wa_component,
    c(
      list("wa-animated-image", .attrs = attrs),
      children
    )
  )
}
# nolint end

Try the shiny.webawesome package in your browser

Any scripts or data that you put into this service are public.

shiny.webawesome documentation built on April 22, 2026, 1:09 a.m.