A to include tooltips in Shiny apps and

Install

Stable CRAN release.

install.packages("tippy") 

Or the .

devtools::install_github("JohnCoene/tippy")
devtools::install_bitbucket("JohnCoene/tippy")

Examples

R Markdown

In .

library(tippy)

# standard
tippy("Hover me!", tooltip = "Hi, I'm the tooltip!")
tippy(
  "Hover me!", 
  tooltip = "Hi, I'm the tooltip!", 
  placement = "right",
  arrow = TRUE
)
tippy(
  "Hover me!", 
  tooltip = "Hi, I'm the tooltip!", 
  animation = "scale",
  duration = 1000, 
  placement = "bottom"
)
tippy(
  "Click me!", 
  tooltip = "Hi, I'm the tooltip!", 
  trigger = "click"
)

You can also use in in-line, tippy("like this", "Here's the tooltip").

Shiny

Works in Shiny apps.

library(shiny)

ui <- fluidPage(
  br(), br(), br(),
  fluidRow(column(12, tippy("Standard tooltip", tooltip = "The tooltip"))),
  fluidRow(column(12, textInput("textInput", "text"))),
  tippy_this(element = "textInput", tooltip =  "Tooltip on other element")
)

server <- function(input, output){}

shinyApp(ui, server)

You can also easily call tippy on multiple elements at once.

library(shiny)

shinyApp(
  ui = fluidPage(
    use_tippy(),
    p("Some text", title = "tooltip"),
    p("Some text", title = "tooltip"),
    p("Some text", title = "tooltip"),
    p("Some text", title = "tooltip"),
    p("Some text", title = "tooltip"),
    p("Some text", title = "tooltip"),
    call_tippy("[title]") # all elements with title
 ),
 server = function(input, output) {}
)