R/wa_callout.R

Defines functions wa_callout

Documented in wa_callout

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

#' Create a `wa-callout` component
#'
#' Generated wrapper for the Web Awesome `wa-callout` 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 appearance Enumerated string. Allowed values: `accent`,
#' `filled`, `filled-outlined`, `outlined`, `plain`. The callout's visual
#' appearance.
#' @param dir String. Optional Web Awesome attribute.
#' @param lang String. Optional Web Awesome attribute.
#' @param size Enumerated string. Allowed values: `large`, `medium`,
#' `small`. Default: `medium`. The callout's size.
#' @param variant Enumerated string. Allowed values: `brand`, `danger`,
#' `neutral`, `success`, `warning`. Default: `brand`. The callout's theme
#' variant. Defaults to `brand` if not within another element with a
#' variant.
#' @param icon An icon to show in the callout. Works best with
#' `<wa-icon>`.
#'
#' @section Shiny Bindings:
#' None.
#'
#' @return An HTML tag for the component.
#'
#' @export
wa_callout <- function(
  ...,
  id = NULL,
  class = NULL,
  style = NULL,
  appearance = NULL,
  dir = NULL,
  lang = NULL,
  size = NULL,
  variant = NULL,
  icon = NULL
) {
  children <- list(...)
  children <- c(
    children,
    list(
      .wa_slot(icon, "icon")
    )
  )

  if (!is.null(appearance)) {
    appearance <- .wa_match_arg(
      appearance,
      "appearance",
      c(
        "accent",
        "filled",
        "filled-outlined",
        "outlined",
        "plain"
      )
    )
  }

  if (!is.null(size)) {
    size <- .wa_match_arg(
      size,
      "size",
      c(
        "large",
        "medium",
        "small"
      )
    )
  }

  if (!is.null(variant)) {
    variant <- .wa_match_arg(
      variant,
      "variant",
      c(
        "brand",
        "danger",
        "neutral",
        "success",
        "warning"
      )
    )
  }

  attrs <- .wa_normalize_attrs(
    list(
      "id" = id,
      "class" = class,
      "style" = style,
      "appearance" = appearance,
      "dir" = dir,
      "lang" = lang,
      "size" = size,
      "variant" = variant
    ),
    boolean_names = character(),
    boolean_arg_names = NULL
  )

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