tooltip on shiny R?

Solution 1:

I think you should be able to replace this:

sliderInput("slider_year", "YEAR:", 
            min = 2001, max = 2011, value = 2009, 
            format="####", locale="us"
)

with this:

tags$div(title="Click here to slide through years",
    sliderInput("slider_year", "YEAR:", 
                min = 2001, max = 2011, value = 2009, 
                format="####", locale="us"
    )
)

Solution 2:

This is slightly easier and more elegant way.

library(shinyBS) # Additional Bootstrap Controls

## From ui.R: Adds a tooltip to element with inputId = "someInput" 
## with text, "This is an input.", that appears to the left on hover.
bsTooltip(id = "someInput", title = "This is an input", 
          placement = "left", trigger = "hover")

## From server.R: Add the same tooltip as above
addTooltip(session, id = "someInput", title = "This is an input.",
           placement = "left", trigger = "hover")

You can add the Tooltip in ui.R or server.R, Additional you can also use Popover.