R/wa_popover.R

Defines functions wa_popover

Documented in wa_popover

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

#' Create a `wa-popover` component
#'
#' Generated wrapper for the Web Awesome `wa-popover` 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 dir String. Optional Web Awesome attribute.
#' @param distance Number. Default: `8`. The distance in pixels from which
#' to offset the popover away from its target.
#' @param for String. Default: `null`. The ID of the popover's anchor
#' element. This must be an interactive/focusable element such as a
#' button.
#' @param lang String. Optional Web Awesome attribute.
#' @param open Boolean. Default: `FALSE`. Shows or hides the popover.
#' @param placement Enumerated string. Allowed values: `bottom`,
#' `bottom-end`, `bottom-start`, `left`, `left-end`, `left-start`,
#' `right`, `right-end`, `right-start`, `top`, `top-end`, `top-start`.
#' Default: `top`. The preferred placement of the popover. Note that the
#' actual placement may vary as needed to keep the popover inside of the
#' viewport.
#' @param skidding Number. Default: `0`. The distance in pixels from which
#' to offset the popover along its target.
#' @param without_arrow Boolean. Default: `FALSE`. Removes the arrow from
#' the popover.
#'
#' @section Shiny Bindings:
#' None.
#'
#' @return An HTML tag for the component.
#'
#' @export
wa_popover <- function(
  ...,
  id = NULL,
  class = NULL,
  style = NULL,
  dir = NULL,
  distance = NULL,
  `for` = NULL,
  lang = NULL,
  open = NULL,
  placement = NULL,
  skidding = NULL,
  without_arrow = NULL
) {
  children <- list(...)

  if (!is.null(placement)) {
    placement <- .wa_match_arg(
      placement,
      "placement",
      c(
        "bottom",
        "bottom-end",
        "bottom-start",
        "left",
        "left-end",
        "left-start",
        "right",
        "right-end",
        "right-start",
        "top",
        "top-end",
        "top-start"
      )
    )
  }

  attrs <- .wa_normalize_attrs(
    list(
      "id" = id,
      "class" = class,
      "style" = style,
      "dir" = dir,
      "distance" = distance,
      "for" = `for`,
      "lang" = lang,
      "open" = open,
      "placement" = placement,
      "skidding" = skidding,
      "without-arrow" = without_arrow
    ),
    boolean_names = c("open", "without-arrow"),
    boolean_arg_names = c(
      "open" = "open",
      "without-arrow" = "without_arrow"
    )
  )

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