title: Show/hide menuItem in shinydashboard
body: <p>I need a menuItem hidden, when the app is entered into. When a user chooses a certain value, the menuItem has to appear. </p>
  
  <p>I have tried <code>shinyjs</code> functions <code>hidden</code>, and it hides a menuItem, but when using <code>show</code> or <code>toggle</code>, a menuItem doesn't appear. </p>
  
  <p>I've found <a href="https://stackoverflow.com/questions/51946319/r-shinydashboard-show-hide-multiple-menuitems-based-on-user-input]">R shinydashboard - show/hide multiple menuItems based on user input</a>
  and came up with this </p>
  
  <pre><code>library(shiny)
  library(shinydashboard)
  library(shinyjs)
  
  
  
  header &lt;- dashboardHeader(title = "APP", titleWidth = 330)
  
  sidebar &lt;- dashboardSidebar(
    sidebarMenu(id="tabs",
                menuItem("",tabName="default"),
                menuItem("Scenarios",tabName = "scenarios", icon = icon("flag")),
                uiOutput("recOpt"),
                menuItem("Simulation", tabName = "game", icon = icon("gamepad")), 
                menuItem("Actions", tabName = "actions", icon = icon("folder"),
                                menuSubItem("Save project", tabName = "save"),
                                menuSubItem("Open project", tabName = "open")
                         )
                )
  )
  
  body &lt;- dashboardBody(
    tabItems(
      tabItem(tabName = "scenarios",
              useShinyjs(),
              radioButtons("radio", h3("Radio buttons"),
                           choices = list("Choice 1" = 1,
                                          "Choice 2" = 2,
                                          "Choice 3" = 3))
      )
    )
  )
  
  
  ui &lt;- dashboardPage(header, sidebar, body)
  
  
  server &lt;- function(input, output) {
    output$recOpt &lt;- renderUI({
        if(input$radio == 2)
          menuItem("Options", tabName = "recOpt", icon = icon("bell"),
                   menuSubItem("No option",tabName="RO_00"),
                   menuSubItem("Option 1",tabName="RO_01")
          )
    })
  }
  
  shinyApp(ui, server)
  </code></pre>
  
  <p>It works but the hidden/shown item is not aligned correcty, nor the encoding is correct. </p>
  
  <p>Have any ideas how to make it better?</p>