R/component-panel.R

Defines functions panelFooter panelBody panelHeading panelTitle panel

#' @export
panel <- function(..., heading = NULL, body = NULL, footer = NULL, variant = c(
  "default", "primary", "success", "info", "warning", "danger"
)) {
  variant <- paste0("panel-", match.arg(variant))

  tags$div(
    class = "panel",
    class = variant,
    heading,
    body,
    footer,
    ...
  )
}

#' @export
panelTitle <- function(..., variant = c("h1", "h2", "h3", "h4", "h5", "h6")) {
  variant <- match.arg(variant)
  htmltools::tag(variant, rlang::list2(class = "panel-title", ...))
}

#' @export
panelHeading <- function(...) {
  tags$div(
    class = "panel-heading",
    ...
  )
}

#' @export
panelBody <- function(...) {
  tags$div(
    class = "panel-body",
    ...
  )
}

#' @export
panelFooter <- function(...) {
  tags$div(
    class = "panel-footer",
    ...
  )
}
shunsambongi/shuny documentation built on Aug. 19, 2022, 9:57 a.m.