Is it possible to display an info text when hovering over a R shiny selectInput?

Viewed 891

I am currently building a shiny app to build biological networks. To build them, you can choose between many different parameters, which i included in different selectInputs or numericInputs. Is it possible to have some kind of info text, when hovering the mouse over those input fields? I dont want to add 3-4 sentences of text to the title of each select/numericInput.

Thanks :)

1 Answers

If you don't mind an extra package dependancy then you can use bsTooltip from the shinyBS package. Note that the hover tooltip sometimes doesn't show up unless you click on the input in the RStudio viewer pane, but if you run your app in your browser, the hover trigger should work:

library(shiny)
library(shinyBS)

ui <- fluidPage(
    selectInput("input1", "Select input", c("choice1", "choice2")),
    bsTooltip(id = "input1", 
              title = "Here is some text with your instructions")
)

server <- function(input, output) {
}

shinyApp(ui = ui, server = server)
Related