Skip to content

Instantly share code, notes, and snippets.

@dmpe
Last active December 6, 2015 16:41
Show Gist options
  • Save dmpe/0ed922e7ee079f6a1aa8 to your computer and use it in GitHub Desktop.
Save dmpe/0ed922e7ee079f6a1aa8 to your computer and use it in GitHub Desktop.
library(shiny)
library(shinydashboard)
header <- dashboardHeader(title = "Dashboard Demo")
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",
icon = icon("fa fa-user-plus")
)
),
sidebarMenuOutput("menu")
)
ui <- dashboardPage(header,
sidebar,
body)
shinyApp(ui, server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment