title: Placeholder for conditionally rendered UI elements in Shiny
body: <p>What is the appropriate placeholder for rendering UI elements in Shiny?  I want parts of the UIs to be rendered based on conditions that are determined in global.R, so not <code>renderUI</code>.  I thought using an empty list or taglist might work, but it doesn't seem to do the job.</p>
  
  <p>Here is an example, when <code>init</code> is TRUE, the first box should be rendered, when <code>init</code> is FALSE only the second box should be rendered.  This second part isn't working quite right.</p>
  
  <pre><code>library(shiny)
  library(shinydashboard)
  
  ## Globally set
  init &lt;- FALSE # sometimes TRUE
  
  ui &lt;- tagList(
      fluidPage(
          tabBox(
              ## What is the appropriate placeholder here?
              if (init) {
                  tabPanel(
                      title='Bad box',
                      box(selectInput('id', 'Appear if TRUE', 1:10))
                  )
              } else 
                  list(),
              tabPanel(
                  title='Good box',
                  box(selectInput('id1', 'Always Apper', letters))
              )
          )
      )
  )
  
  server &lt;- function(session, input, output) { }
  
  shinyApp(ui, server)
  </code></pre>