Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201945

Linking valueBox title to different tabPanel

$
0
0

Suppose you have a basic shinydashboard app with two tabPanels within a tabBox:

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(title = "Basic dashboard"),
  dashboardSidebar(),
  dashboardBody(

    fluidRow(width = 12, 
             tabBox(width = 12,
                    tabPanel("Info 1",
                             fluidRow(
                               valueBoxOutput("box")
                             )
                    ) ,

                    tabPanel("Info 2",
                             "Some Info about Tab 2."  
                    )
             )
    )
  )
)


server <- function(input, output) {

  output$box<-renderValueBox(     

    valueBox(
      value = "ValueBox Title",
      subtitle = tagList("Some information about the box.",
                         p(""),
                         "Some more information about the box."
      ),
      icon = icon("user-check"),
      color = "green"
    ))

}

app<-shinyApp(ui = ui, server = server)
runApp(app, host="0.0.0.0",port=5060, launch.browser = TRUE)

In one tabPanel (called "Info 1" here) you have a valueBox with a title (in this case "ValueBox Title"). Is it possible to make the title of the valueBox a hyperlink such that it opens up the tabPanel called "Info 2"?

Within my app I wish to have a tabPanel which shows summary information for the entire analysis. If a user wishes to drill down and get more information about the summary data presented in the valueBox I want to take them to a different tab which contains more data.


Viewing all articles
Browse latest Browse all 201945

Trending Articles