R/wa_tooltip.R

Defines functions wa_tooltip

Documented in wa_tooltip

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

#' Create a `wa-tooltip` component
#'
#' Generated wrapper for the Web Awesome `wa-tooltip` 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 disabled Boolean. Default: `FALSE`. Disables the tooltip so it
#' won't show when triggered.
#' @param dir String. Optional Web Awesome attribute.
#' @param distance Number. Default: `8`. The distance in pixels from which
#' to offset the tooltip away from its target.
#' @param for String. Default: `null`. Optional Web Awesome attribute.
#' @param hide_delay Number. Default: `0`. The amount of time to wait
#' before hiding the tooltip when the user mouses out.
#' @param lang String. Optional Web Awesome attribute.
#' @param open Boolean. Default: `FALSE`. Indicates whether or not the
#' tooltip is open. You can use this in lieu of the show/hide methods.
#' @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 tooltip. Note that the
#' actual placement may vary as needed to keep the tooltip inside of the
#' viewport.
#' @param show_delay Number. Default: `150`. The amount of time to wait
#' before showing the tooltip when the user mouses in.
#' @param skidding Number. Default: `0`. The distance in pixels from which
#' to offset the tooltip along its target.
#' @param trigger String. Default: `hover focus`. Controls how the tooltip
#' is activated. Possible options include `click`, `hover`, `focus`, and
#' `manual`. Multiple options can be passed by separating them with a
#' space. When manual is used, the tooltip must be activated
#' programmatically.
#' @param without_arrow Boolean. Default: `FALSE`. Removes the arrow from
#' the tooltip.
#'
#' @section Shiny Bindings:
#' None.
#'
#' @return An HTML tag for the component.
#'
#' @export
wa_tooltip <- function(
  ...,
  id = NULL,
  class = NULL,
  style = NULL,
  disabled = NULL,
  dir = NULL,
  distance = NULL,
  `for` = NULL,
  hide_delay = NULL,
  lang = NULL,
  open = NULL,
  placement = NULL,
  show_delay = NULL,
  skidding = NULL,
  trigger = 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,
      "disabled" = disabled,
      "dir" = dir,
      "distance" = distance,
      "for" = `for`,
      "hide-delay" = hide_delay,
      "lang" = lang,
      "open" = open,
      "placement" = placement,
      "show-delay" = show_delay,
      "skidding" = skidding,
      "trigger" = trigger,
      "without-arrow" = without_arrow
    ),
    boolean_names = c(
      "disabled",
      "open",
      "without-arrow"
    ),
    boolean_arg_names = c(
      "disabled" = "disabled",
      "open" = "open",
      "without-arrow" = "without_arrow"
    )
  )

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