add popovers in shiny apps

I am working on an R shiny project and need to add popovers to some shiny ui objects to guide the user input.

The initial state has the label, circled question mark following the label, and the numericInput field below the label. After hovering the mouse on the circled question mark, a popover will appear to provide additional tips about data entry for the numericInput. After clicking the circled question mark, the numericInput field will be highlighted. Once the mouse leaves the circled question mark, the popover will disappear.

How can this be done? Thank you very much!

You can use the shinyBS package for this:
https://ebailey78.github.io/shinyBS/docs/Tooltips_and_Popovers.html

I'm not sure it fits to all your requirements but could be useful:

library(prompter)
library(shiny)


ui <- fluidPage(
  use_prompt(),
  br(),
  selectInput(
    "foo",
    label = tags$span(
      "Select an input", 
      tags$span(
        icon(
          name = "question-circle",
        ) 
      ) |>
        add_prompt(message = "This is some help text.", position = "right")
    ), 
    choices = NULL
  )
)

server <- function(input, output, session) {}

shinyApp(ui, server)

Thank you very much! This is exactly what I am looking for.

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.