R/wa_include.R

Defines functions wa_include

Documented in wa_include

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

#' Create a `wa-include` component
#'
#' Generated wrapper for the Web Awesome `wa-include` 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 allow_scripts Boolean. Default: `FALSE`. Allows included scripts
#' to be executed. Be sure you trust the content you are including as it
#' will be executed as code and can result in XSS attacks.
#' @param dir String. Optional Web Awesome attribute.
#' @param lang String. Optional Web Awesome attribute.
#' @param mode Enumerated string. Allowed values: `cors`, `no-cors`,
#' `same-origin`. Default: `cors`. The fetch mode to use.
#' @param src String. The location of the HTML file to include. Be sure
#' you trust the content you are including as it will be executed as code
#' and can result in XSS attacks.
#'
#' @section Shiny Bindings:
#' None.
#'
#' @return An HTML tag for the component.
#'
#' @export
wa_include <- function(
  ...,
  id = NULL,
  class = NULL,
  style = NULL,
  allow_scripts = NULL,
  dir = NULL,
  lang = NULL,
  mode = NULL,
  src = NULL
) {
  children <- list(...)

  if (!is.null(mode)) {
    mode <- .wa_match_arg(
      mode,
      "mode",
      c(
        "cors",
        "no-cors",
        "same-origin"
      )
    )
  }

  attrs <- .wa_normalize_attrs(
    list(
      "id" = id,
      "class" = class,
      "style" = style,
      "allow-scripts" = allow_scripts,
      "dir" = dir,
      "lang" = lang,
      "mode" = mode,
      "src" = src
    ),
    boolean_names = c("allow-scripts"),
    boolean_arg_names = c("allow-scripts" = "allow_scripts")
  )

  do.call(
    .wa_component,
    c(
      list("wa-include", .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.