Description Usage Arguments Value See Also Examples
Use this first before addMessageData adds to the notification menu when stuff happens
1 2 | initMessageData(text = c("Welcome! Authenticate to get started."),
icon = c("smile-o"), status = c("info"))
|
text |
Text of message. |
icon |
Icon taken from shinydashboard. |
status |
Color of message. See Details. |
messageData Object to be passed to addMessageData().
http://rstudio.github.io/shinydashboard/appearance.html#icons
Other message functions: addMessageData
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 | ## Not run:
## server.r
shinyServer(function(input, output, session) {
messageData <- initMessageData()
addMessageData(messageData, "A new message!")
output$messageMenu <- renderDropdownMenu({
message_df <- data.frame(text = messageData$text,
icon = messageData$icon,
status = messageData$status)
msgs <- apply(message_df, 1, function(row){
notificationItem(text = row[['text']],
icon = icon(row[['icon']]),
status = row[['status']])
})
dropdownMenu(type="notifications", .list = msgs)
})
}
## ui.r
dashboardHeader(title = "GA Forecast",
dropdownMenuOutput("messageMenu"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.