-
Notifications
You must be signed in to change notification settings - Fork 29
/
gentelellaBody.R
56 lines (47 loc) · 1.09 KB
/
gentelellaBody.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
56
#' Create a Gentelella dashboard body content
#'
#' @param ... Items to place in the body such as \link{tabItems} an \link{tabItem}
#'
#' @author David Granjon, \email{dgranjon@@ymail.com}
#'
#' @export
#' @importFrom htmltools withTags
#' @importFrom shiny div
gentelellaBody <- function(...) {
withTags({
div(
class = "right_col",
role = "main",
style = "min-height: 1775px;",
...
)
})
}
#' A container for tab items
#'
#' @param ... Items to put in the container. Each item should be a \code{\link{tabItem}}.
#'
#' @export
#' @import shiny
tabItems <- function(...) {
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{sidebarItem}}.
#' @param ... Contents of the tab.
#'
#' @export
#' @import shiny
tabItem <- function(tabName = NULL, ...) {
if (is.null(tabName))
stop("Need tabName")
tags$div(
role = "tabpanel",
class = "tab-pane container-fluid",
id = paste0("shiny-tab-", tabName),
br(),
...
)
}