R/wa_button_group.R

Defines functions wa_button_group

Documented in wa_button_group

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

#' Create a `wa-button-group` component
#'
#' Generated wrapper for the Web Awesome `wa-button-group` 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 label String. Default: `""`. A label to use for the button
#' group. This won't be displayed on the screen, but it will be announced
#' by assistive devices when interacting with the control and is strongly
#' recommended.
#' @param dir String. Optional Web Awesome attribute.
#' @param lang String. Optional Web Awesome attribute.
#' @param orientation Enumerated string. Allowed values: `horizontal`,
#' `vertical`. Default: `horizontal`. The button group's orientation.
#'
#' @section Shiny Bindings:
#' None.
#'
#' @return An HTML tag for the component.
#'
#' @export
wa_button_group <- function(
  ...,
  id = NULL,
  class = NULL,
  style = NULL,
  label = NULL,
  dir = NULL,
  lang = NULL,
  orientation = NULL
) {
  children <- list(...)

  if (!is.null(orientation)) {
    orientation <- .wa_match_arg(
      orientation,
      "orientation",
      c(
        "horizontal",
        "vertical"
      )
    )
  }

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

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