R/wa_comparison.R

Defines functions wa_comparison

Documented in wa_comparison

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

#' Create a `wa-comparison` component
#'
#' Generated wrapper for the Web Awesome `wa-comparison` component. When
#' used as a Shiny input, `input$<input_id>` reflects the component's
#' current `value` value.
#' Generated from Web Awesome metadata.
#'
#' @param ... Child content for the component's default slot.
#' @param input_id Shiny input id for the component. This is also used as
#' the rendered DOM `id` attribute.
#' @param class Optional CSS class string.
#' @param style Optional inline CSS style string.
#' @param dir String. Optional Web Awesome attribute.
#' @param lang String. Optional Web Awesome attribute.
#' @param position Number. Default: `50`. The position of the divider as a
#' percentage.
#' @param after The after content, often an `<img>` or `<svg>` element.
#' @param before The before content, often an `<img>` or `<svg>` element.
#' @param handle The icon used inside the handle.
#'
#' @section Shiny Bindings:
#' `input$<input_id>` reflects the component's current `value` value.
#'
#' @return An HTML tag for the component.
#'
#' @export
wa_comparison <- function(
  input_id,
  ...,
  class = NULL,
  style = NULL,
  dir = NULL,
  lang = NULL,
  position = NULL,
  after = NULL,
  before = NULL,
  handle = NULL
) {
  children <- list(...)
  children <- c(
    children,
    list(
      .wa_slot(after, "after")
    )
  )
  children <- c(
    children,
    list(
      .wa_slot(before, "before")
    )
  )
  children <- c(
    children,
    list(
      .wa_slot(handle, "handle")
    )
  )

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

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