title: Shiny: Independently navigate two tabsetPanels
body: <p><strong>Is it possible to navigate two menus independently in Shiny?</strong> </p>
  
  <p>I would like to have two tabsetPanels (see the figure below), but if I change between tabs in the upper menu, I want the selected panel in the lower menu to persist.</p>
  
  <p>One way to navigate multiple tabsetPanels is by simply running another Shiny app inside my main app. However, this is not the desired result, because switching tabs in the upper menu will now also affect which tab is open in the lower menu.</p>
  
  <p>Example of what I'm using now:</p>
  
  <pre><code>library(shiny)
  
  ui &lt;- fluidPage(
    tabsetPanel(
      tabPanel("Normal", shinyAppDir("Distributions/Normal"))),
      tabPanel("Binomial", shinyAppDir("Distributions/Binomial"))
      # etc.
    )
  )
  </code></pre>
  
  <p>Where each called app has its own tabsetPanel:</p>
  
  <pre><code>ui &lt;- fluidPage(
    tabsetPanel(
                tabPanel("Theoretical distribution", plotOutput("plot1")),
                tabPanel("Draw Samples", plotOutput("plot2")),
                tabPanel("Explanation", verbatimTextOutput("explanation"))
    )
  )
  </code></pre>
  
  <p>The result:</p>
  
  <p><a href="https://i.stack.imgur.com/y7oq6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y7oq6.png" alt="two_menus"></a></p>