Learn R Programming

shinyBS (version 0.20)

addTooltip: Twitter Bootstrap Tooltips

Description

Functions to add Twitter Bootstrap tooltips in shiny.

Usage

addTooltip(session, id, title, placement = "bottom", trigger = "hover")
bsTooltip(id, title, placement = "bottom", trigger = "hover")
removeTooltip(session, id)

Arguments

session
The session object passed to function given to shinyServer
id
The inputId of the object to add the tooltip to
title
The text of the tooltip
placement
Where the tooltip should appear in relation to the object. Acceptable values are bottom, top, left, and right.
trigger
What action will make the tooltip appear. Common values are hover or click.

Details

bsTooltip is called from ui.R and will add a

References

http://getbootstrap.com/2.3.2/javascript.html{Tooltips for Twitter Bootstrap 2.3.2}

Examples

Run this code
## 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")

Run the code above in your browser using DataLab