Skip to content

Instantly share code, notes, and snippets.

@dmpe
Created December 6, 2015 16:14
Show Gist options
  • Save dmpe/0e3bdf2ec802fd8aaabe to your computer and use it in GitHub Desktop.
Save dmpe/0e3bdf2ec802fd8aaabe to your computer and use it in GitHub Desktop.
library(shiny)
library(shinydashboard)
header <- dashboardHeader(
title = "Dashboard Demo",
# Dropdown menu for messages
dropdownMenu(
type = "messages",
badgeStatus = "success",
messageItem("Support Team",
"This is the content of a message.",
time = "5 mins"),
messageItem("Support Team",
"This is the content of another message.",
time = "2 hours"),
messageItem("New User",
"Can I get some help?",
time = "Today")
),
# Dropdown menu for tasks, with progress bar
dropdownMenu(
type = "tasks",
badgeStatus = "danger",
taskItem(value = 20, color = "aqua",
"Refactor code"),
taskItem(value = 40, color = "green",
"Design new layout"),
taskItem(value = 60, color = "yellow",
"Another task"),
taskItem(value = 80, color = "red",
"Write documentation")
)
)
body <- dashboardBody()
server <- function(input, output) {
}
sidebar <- dashboardSidebar(
sidebarSearchForm(label = "Enter a number", "searchText", "searchButton"),
sidebarMenu(
# Setting id makes input$tabs give the tabName of currently-selected tab
id = "tabs",
menuItem(
"Dashboard",
tabName = "dashboard",
icon = icon("dashboard")
),
menuItem(
"Widgets",
icon = icon("th"),
tabName = "widgets",
badgeLabel = "new",
badgeColor = "green"
),
menuItem(
"Charts",
icon = icon("bar-chart-o"),
menuSubItem("Sub-item 1", tabName = "subitem1"),
menuSubItem("Sub-item 2", tabName = "subitem2")
),
menuItem(
"test stack",
tabName = "t_donorTrends",
icon = span(
class = "fa fa-user-plus",
icon("user", "fa-stack-1x"),
icon("ban", "fa-stack-2x")
)
)
),
sidebarMenuOutput("menu")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment