title: Dynamic popover or tooltip in shinyBS
body: <p><strong>The idea</strong></p>
  
  <p>I have a <code>box()</code> in a shiny app. The <code>box()</code> includes a <code>title</code> argument (which in turn includes an <code>icon</code>) and a <code>selectInput()</code>element. On hoover over the <code>icon</code> I wanted to have a tooltip (using <code>tipify()</code>) or a popover (using  <code>popify()</code>) which <code>title</code> or <code>content</code> argument (or both) would be generated depending on <code>selectInput()</code> input.</p>
  
  <p><strong>The problem</strong></p>
  
  <p>Neither <code>tipify()</code> nor <code>popify()</code> correcctly implement <code>textOutput()</code> as their <code>title</code> or <code>content</code> argument. They need a character string so I tried to use a <code>reactiveValues()</code> element as a function argument but it also failed.</p>
  
  <p><strong>The question</strong></p>
  
  <p>Can tooltip or popover content be made dynamic by just using <code>r</code>? How could this be done?</p>
  
  <p>I suspect it can be done with <code>JavaScript</code> but I have little knowledge of it.</p>
  
  <p><strong>The code</strong></p>
  
  <p>Attempt 1 - failed - displays code not actual text</p>
  
  <pre><code>library("shiny")
  library("shinydashboard")
  library("shinyBS")
  
  ui &lt;- fluidPage(
   box(
     title = span("My box",
                  tipify(el = icon(name = "info-circle", lib = "font-awesome"), title = textOutput("TIP"))),
     selectInput(
       inputId = "SELECT",
       label = NULL,
       choices = c("Option1" = "Option1",
                   "Option2" = "Option2"
       ),
       multiple = FALSE
     )
   )
  )
  server &lt;- function(input, output, session){
    output$TIP &lt;- renderText({"Helo world!"})
  }
  shinyApp(ui, server)
  </code></pre>
  
  <p>Attempt 2 - failed - cannot create UI as TIP (<code>reactiveValues()</code>) is not yet defined</p>
  
  <pre><code>library("shiny")
  library("shinydashboard")
  library("shinyBS")
  
  ui &lt;- fluidPage(
   box(
     title = span("My box",
                  tipify(el = icon(name = "info-circle", lib = "font-awesome"), title = TIP$a)),
     selectInput(
       inputId = "SELECT",
       label = NULL,
       choices = c("Option1" = "Option1",
                   "Option2" = "Option2"
       ),
       multiple = FALSE
     )
   )
  )
  server &lt;- function(input, output, session){
    TIP &lt;- reactiveValues(a = "Hello world!")
  }
  shinyApp(ui, server)
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/34980348/reactive-tooltipbs-in-shiny-using-shinybs">Here</a> is a similar question but it does not solve the problem described here.</p>