简体   繁体   中英

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

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:)

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM