-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdashboardBody.R
55 lines (47 loc) · 1.12 KB
/
dashboardBody.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#' Create a Boostrap 4 dashboard body
#'
#' Build a tabler dashboard body
#'
#' @param ... Body content, slot for \link{tablerTabItems}.
#'
#' @author David Granjon, \email{dgranjon@@ymail.com}
#'
#' @export
tablerDashBody <- function(...) {
shiny::tags$div(
class = "my-3 my-md-5",
shiny::tags$div(
class = "container",
...
)
)
}
#' A container for tab items
#'
#' @param ... Items to put in the container. Each item should be a
#' \code{\link{tablerTabItem}}.
#'
#' @export
tablerTabItems <- function(...) {
lapply(list(...), tagAssert, class = "tab-pane")
shiny::tags$div(class = "tab-content", ...)
}
#' One tab to put inside a tab items container
#'
#' @param tabName The name of a tab. This must correspond to the \code{tabName}
#' of a \code{\link{tablerNavMenuItem}}.
#' @param ... Contents of the tab.
#'
#' @export
tablerTabItem <- function(tabName = NULL, ...) {
if (is.null(tabName))
stop("Need tabName")
validateTabName(tabName)
shiny::tags$div(
role = "tabpanel",
class = "tab-pane container-fluid",
id = paste0("shiny-tab-", tabName),
shiny::br(),
...
)
}