Description Usage Arguments Author(s) See Also Examples
dropdownMenu creates an adminLTE3 dashboard dropdown menu, to be inserted in a dashboardHeader.
messageItem creates a message item to place in a dropdownMenu.
messageItem creates a message item to place in a dropdownMenu.
taskItem creates a task item to place in a dropdownMenu.
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 | bs4DropdownMenu(
...,
type = c("messages", "notifications", "tasks"),
badgeStatus = "primary",
icon = NULL,
headerText = NULL,
.list = NULL,
href = NULL
)
messageItem(
from,
message,
icon = shiny::icon("user"),
time = NULL,
href = NULL,
image = NULL,
color = "secondary",
inputId = NULL
)
notificationItem(
text,
icon = shiny::icon("warning"),
status = "success",
href = NULL,
inputId = NULL
)
taskItem(text, value = 0, color = "info", href = NULL, inputId = NULL)
dropdownMenu(
...,
type = c("messages", "notifications", "tasks"),
badgeStatus = "primary",
icon = NULL,
headerText = NULL,
.list = NULL,
href = NULL
)
|
... |
Items to put in the menu. Typically, message menus should contain
|
type |
The type of menu. Should be one of "messages", "notifications", "tasks". |
badgeStatus |
The status of the badge which displays the number of items in the menu. This determines the badge's color. Valid statuses are defined as follows:
.
A value of |
icon |
An icon tag, created by |
headerText |
An optional text argument used for the header of the
dropdown menu (this is only visible when the menu is expanded). If none is
provided by the user, the default is "You have |
.list |
An optional list containing items to put in the menu Same as the
|
href |
An optional URL to link to. |
from |
Who the message is from. |
message |
Text of the message. |
time |
String representing the time the message was sent. Any string may be used. For example, it could be a relative date/time like "5 minutes", "today", or "12:30pm yesterday", or an absolute time, like "2014-12-01 13:45". If NULL, no time will be displayed. |
image |
User image. |
color |
A color for the bar. Valid colors are defined as follows:
|
inputId |
Whether to allow the item to act as a actionButton. |
text |
The task text. |
status |
The status of the item. This determines the item's background color. Valid statuses are defined as follows:
|
value |
A percent value to use for the bar. |
David Granjon, dgranjon@ymail.com
dashboardHeader
for example usage.
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 57 | if (interactive()) {
library(shiny)
library(bs4Dash)
shinyApp(
ui = dashboardPage(
header = dashboardHeader(
rightUi = dropdownMenu(
badgeStatus = "danger",
type = "messages",
messageItem(
inputId = "triggerAction1",
message = "message 1",
from = "Divad Nojnarg",
image = "https://adminlte.io/themes/v3/dist/img/user3-128x128.jpg",
time = "today",
color = "lime"
)
),
leftUi = 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
)
)
)
),
sidebar = dashboardSidebar(),
controlbar = dashboardControlbar(),
footer = dashboardFooter(),
title = "dropdownMenu",
body = dashboardBody()
),
server = function(input, output) {
observeEvent(input$triggerAction1, {
showModal(modalDialog(
title = "Important message",
"This is an important message!"
))
})
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.