R/wa_tree_item.R

Defines functions wa_tree_item

Documented in wa_tree_item

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

#' Create a `wa-tree-item` component
#'
#' Generated wrapper for the Web Awesome `wa-tree-item` 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 tree item.
#' @param dir String. Optional Web Awesome attribute.
#' @param expanded Boolean. Default: `FALSE`. Expands the tree item.
#' @param lang String. Optional Web Awesome attribute.
#' @param lazy Boolean. Default: `FALSE`. Enables lazy loading behavior.
#' @param selected Boolean. Default: `FALSE`. Draws the tree item in a
#' selected state.
#' @param collapse_icon The icon to show when the tree item is collapsed.
#' @param expand_icon The icon to show when the tree item is expanded.
#'
#' @section Shiny Bindings:
#' None.
#'
#' @return An HTML tag for the component.
#'
#' @export
wa_tree_item <- function(
  ...,
  id = NULL,
  class = NULL,
  style = NULL,
  disabled = NULL,
  dir = NULL,
  expanded = NULL,
  lang = NULL,
  lazy = NULL,
  selected = NULL,
  collapse_icon = NULL,
  expand_icon = NULL
) {
  children <- list(...)
  children <- c(
    children,
    list(
      .wa_slot(collapse_icon, "collapse-icon")
    )
  )
  children <- c(
    children,
    list(
      .wa_slot(expand_icon, "expand-icon")
    )
  )

  attrs <- .wa_normalize_attrs(
    list(
      "id" = id,
      "class" = class,
      "style" = style,
      "disabled" = disabled,
      "dir" = dir,
      "expanded" = expanded,
      "lang" = lang,
      "lazy" = lazy,
      "selected" = selected
    ),
    boolean_names = c(
      "disabled",
      "expanded",
      "lazy",
      "selected"
    ),
    boolean_arg_names = c(
      "disabled" = "disabled",
      "expanded" = "expanded",
      "lazy" = "lazy",
      "selected" = "selected"
    )
  )

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