Builds application header with given configurations and elements. It is called within "ui_header.R". These elements will be displayed in the header beside application title and application busy indicator.
It can be any UI element but mostly used for navbarMenu. NULL by default.
Check ?bs4Dash::navbarMenu()
Location of UI elements in the header. Must be either of 'center', 'left' or 'right' Default value is 'right'.
Sets application title. If it is not NULL, it will override "title" value that is set in
?periscope2::set_app_parameters()
(default = NULL)
Location of the title in the header. Must be either of 'center', 'left' or 'right' Default value is 'Center'. If there are no UI elements, this param will be ignored.
Left menu. bs4DropdownMenu object (or similar dropdown menu).
Check ?bs4Dash::bs4DropdownMenu()
Right menu. bs4DropdownMenu object (or similar dropdown menu).
Check ?bs4Dash::bs4DropdownMenu()
Whether to separate the navbar and body by a border. TRUE by default
Whether items should be compacted. FALSE by default
Right sidebar toggle icon
Whether to fix the navbar to the top. FALSE by default
Left sidebar toggle icon
Sidebar skin. "dark" or "light"
Sidebar status. Check ?bs4Dash::bs4DashNavbar()
for list of valid values
list of both shiny UI elements and named header properties
An automatic wait indicator that are shown when the shiny server session is busy
Display application title
Optional header menu to switch between application different tabs
Header elements can be arranged via ui_position
and title_position
parameters.
Header elements look and feel can also be configured in "www\css\custom.css" file under
"Application Header" section.
Check example application for detailed example
Call this function from program/ui_header.R
to set header parameters
library(shiny)
library(bs4Dash)
# Inside ui_header.R
# Custom left UI menu
left_menu <- tagList(dropdownMenu(badgeStatus = "info",
type = "notifications",
notificationItem(inputId = "triggerAction2",
text = "Error!",
status = "danger")),
dropdownMenu(badgeStatus = "info",
type = "tasks",
taskItem(inputId = "triggerAction3",
text = "My progress",
color = "orange",
value = 10)))
# Custom right UI menu
right_menu <- dropdownMenu(badgeStatus = "danger",
type = "messages",
messageItem(inputId = "triggerAction1",
message = "message 1",
from = "Divad Nojnarg",
time = "today",
color = "lime"))
# -- Register Header Elements in the ORDER SHOWN in the UI
add_ui_header(left_menu = left_menu, right_menu = right_menu)