Create a header of a dashboard with other additional UI elements.
Hint: use shiny::tagList()
if you want to add multiple elements in left
/ center
or right
.
dashboard_header(
...,
left = NULL,
center = NULL,
right = NULL,
title = NULL,
titleWidth = "thin",
logo_align = "center",
logo_path = "",
color = "",
inverted = FALSE,
disable = FALSE,
show_menu_button = TRUE,
menu_button_label = "Menu",
class = ""
)dashboardHeader(
...,
left = NULL,
center = NULL,
right = NULL,
title = NULL,
titleWidth = "thin",
logo_align = "center",
logo_path = "",
color = "",
inverted = FALSE,
disable = FALSE,
show_menu_button = TRUE,
menu_button_label = "Menu",
class = ""
)
UI elements to include within the header. They will be displayed on the right side.
UI element to put on the left of the header. It will be placed after (to the right) the title and menu button (if they exist).
UI element to put in the center of the header.
UI element to put to the right of the header. It will be placed before elements defined in ...
(if there are any).
Dashboard title to be displayed in the upper left corner. If NULL, will not display any title field. Use "" for an empty title.
Title field width, one of c(NULL, "very thin", "thin", "wide", "very wide")
Where should logo be placed. One of c("left", "center")
Path or URL of the logo to be shown in the header.
Color of the sidebar / text / icons (depending on the value of `inverted` parameter. \
One of c("", "red", "orange", "yellow", "olive", "green", "teal", "blue", "violet", "purple", "pink", "brown", "grey", "black")
If FALSE sidebar will be white and text will be colored. \
If TRUE text will be white and background will be colored. Default is FALSE
.
If TRUE
, don't display the header.
If FALSE
, don't display the menu button. Default is TRUE
.
Text of the menu button. Default is "Menu"
.
CSS class to be applied to the container of dashboardHeader
.
A header that can be passed to dashboardPage
dashboardHeader
: Create a header of a dashboard (alias for dashboard_header
for compatibility with shinydashboard
)
# NOT RUN {
if(interactive()) {
library(shiny)
library(semantic.dashboard)
ui <- dashboardPage(
dashboardHeader(color = "blue", inverted = TRUE),
dashboardSidebar(side = "left", size = "thin", color = "teal",
sidebarMenu(
menuItem(tabName = "tab1", "Tab 1"),
menuItem(tabName = "tab2", "Tab 2"))),
dashboardBody(tabItems(
tabItem(tabName = "tab1", p("Tab 1")),
tabItem(tabName = "tab2", p("Tab 2"))))
)
server <- function(input, output) {
}
shinyApp(ui, server)
}
# }
Run the code above in your browser using DataLab