R/triggerId.R

Defines functions component

Documented in component

component <- function(name, module = "@mui/material") {
  function(triggerId, ...) {
    checkmate::assert_string(triggerId)
    tag <- shiny.react::reactElement(
      module = module,
      name = name,
      props = shiny.react::asProps(triggerId = triggerId, ...),
      deps = muiMaterialDependency()
    )
    class(tag) <- c("muiMaterial", class(tag))
    tag
  }
}

#' Drawer.triggerId
#'
#' Custom Drawer for mobiles using Drawer component. See 'js/src/Drawer.triggerId.jsx'.
#'
#' @export
#' @param triggerId HTML id of an existing DOM element that acts as the trigger (button, link, etc.) to open the Drawer.
#' @param ... args to pass to element
#' @return Object with `shiny.tag` class suitable for use in the UI of a Shiny app.
Drawer.triggerId <- component(
  "MuiDrawerTriggerId",
  module = "@/muiMaterial"
)

#' Menu.triggerId
#'
#' Custom Menu using Menu component. See 'js/src/MuiMenuTriggerId.jsx'.
#'
#' @export
#' @param triggerId HTML id of an existing DOM element that acts as the trigger (button, link, etc.) to open the Menu.
#' @param ... args to pass to element
#' @return Object with `shiny.tag` class suitable for use in the UI of a Shiny app.
Menu.triggerId <- component(
  "MuiMenuTriggerId",
  module = "@/muiMaterial"
)

#' SwipeableDrawer.triggerId
#'
#' Custom Drawer for mobiles using SwipeableDrawer component. See 'js/src/SwipeableDrawer.triggerId.jsx'.
#'
#' @export
#' @param triggerId HTML id of an existing DOM element that acts as the trigger (button, link, etc.) to open the Drawer.
#' @param ... args to pass to element
#' @return Object with `shiny.tag` class suitable for use in the UI of a Shiny app.
SwipeableDrawer.triggerId <- component(
  "MuiSwipeableDrawerTriggerId",
  module = "@/muiMaterial"
)

Try the muiMaterial package in your browser

Any scripts or data that you put into this service are public.

muiMaterial documentation built on March 15, 2026, 5:07 p.m.