R/wa_split_panel.R

Defines functions wa_split_panel

Documented in wa_split_panel

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

#' Create a `wa-split-panel` component
#'
#' Generated wrapper for the Web Awesome `wa-split-panel` 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 resizing. Note that
#' the position may still change as a result of resizing the host element.
#' @param dir String. Optional Web Awesome attribute.
#' @param lang String. Optional Web Awesome attribute.
#' @param orientation Enumerated string. Allowed values: `horizontal`,
#' `vertical`. Default: `horizontal`. Sets the split panel's orientation.
#' @param position Number. Default: `50`. The current position of the
#' divider from the primary panel's edge as a percentage 0-100. Defaults
#' to 50% of the container's initial size.
#' @param position_in_pixels Number. The current position of the divider
#' from the primary panel's edge in pixels.
#' @param primary Enumerated string. Allowed values: `end`, `start`. If no
#' primary panel is designated, both panels will resize proportionally
#' when the host element is resized. If a primary panel is designated, it
#' will maintain its size and the other panel will grow or shrink as
#' needed when the host element is resized.
#' @param snap String. One or more space-separated values at which the
#' divider should snap. Values can be in pixels or percentages, e.g.
#' `"100px 50%"`.
#' @param snap_threshold Number. Default: `12`. How close the divider must
#' be to a snap point until snapping occurs.
#' @param divider The divider. Useful for slotting in a custom icon that
#' renders as a handle.
#' @param end Content to place in the end panel.
#' @param start Content to place in the start panel.
#'
#' @section Shiny Bindings:
#' None.
#'
#' @return An HTML tag for the component.
#'
#' @export
wa_split_panel <- function(
  ...,
  id = NULL,
  class = NULL,
  style = NULL,
  disabled = NULL,
  dir = NULL,
  lang = NULL,
  orientation = NULL,
  position = NULL,
  position_in_pixels = NULL,
  primary = NULL,
  snap = NULL,
  snap_threshold = NULL,
  divider = NULL,
  end = NULL,
  start = NULL
) {
  children <- list(...)
  children <- c(
    children,
    list(
      .wa_slot(divider, "divider")
    )
  )
  children <- c(
    children,
    list(
      .wa_slot(end, "end")
    )
  )
  children <- c(
    children,
    list(
      .wa_slot(start, "start")
    )
  )

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

  if (!is.null(primary)) {
    primary <- .wa_match_arg(
      primary,
      "primary",
      c(
        "end",
        "start"
      )
    )
  }

  attrs <- .wa_normalize_attrs(
    list(
      "id" = id,
      "class" = class,
      "style" = style,
      "disabled" = disabled,
      "dir" = dir,
      "lang" = lang,
      "orientation" = orientation,
      "position" = position,
      "position-in-pixels" = position_in_pixels,
      "primary" = primary,
      "snap" = snap,
      "snap-threshold" = snap_threshold
    ),
    boolean_names = c("disabled"),
    boolean_arg_names = c("disabled" = "disabled")
  )

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