1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tooltip.R
\name{tooltip}
\alias{tooltip}
\title{Create a bootstrap tooltip}
\usage{
tooltip(
refId,
text,
attr = NULL,
animation = TRUE,
delay = 100,
html = TRUE,
placement = "auto",
trigger = "hover"
)
}
\arguments{
\item{refId}{\code{\link{character}} (\strong{required}):
id of the element the tooltip is to be attached to.}
\item{text}{\code{\link{character}} (\strong{required}):
Text to be displayed in the tooltip.}
\item{attr}{\code{\link{character}} (\emph{optional}):
Attach tooltip to all elements with attribute \code{attr='refId'}.}
\item{animation}{\code{\link{logical}} (\emph{with default}):
Apply a CSS fade transition to the tooltip.}
\item{delay}{\code{\link{numeric}} (\emph{with default}):
Delay showing and hiding the tooltip (ms).}
\item{html}{\code{\link{logical}} (\emph{with default}):
Insert HTML into the tooltip.}
\item{placement}{\code{\link{character}} (\emph{with default}):
How to position the tooltip - \code{top} | \code{bottom} | \code{left} | \code{right} | \code{auto}.
When 'auto' is specified, it will dynamically reorient the tooltip.
For example, if placement is 'auto left', the tooltip will display to the
left when possible, otherwise it will display right.}
\item{trigger}{\code{\link{character}} (\emph{with default}):
How tooltip is triggered - \code{click} | \code{hover} | \code{focus} | \code{manual}.
You may pass multiple triggers; separate them with a space.}
}
\description{
Create bootstrap tooltips for any HTML element to be used in shiny applications.
}
\examples{
# javascript code
tt <- tooltip("elementId", "This is a tooltip.")
str(tt)
# example app
\dontrun{
shinyApp(
ui = fluidPage(
jscolorInput(inputId = "col", label = "JSColor Picker",
value = "21BF6B", position = "right",
mode = "HVS", close = TRUE),
tooltip("col", "This is a JScolor widget"),
checkboxInput("cbox", "Checkbox", FALSE),
tooltip("cbox", "This is a checkbox"),
checkboxGroupInput("cboxg", "Checkbox group", selected = "a",
choices = c("a" = "a",
"b" = "b",
"c" = "c")),
tooltip("cboxg", "This is a <b>checkbox group</b>", html = TRUE),
selectInput("select", "Selectinput", selected = "a", choices = c("a"="a", "b"="b")),
tooltip("select", "This is a text input field", attr = "for", placement = "right"),
passwordInput("pwIn", "Passwordinput"),
tooltip("pwIn", "This is a password input field"),
plotOutput("plot")
),
server = function(input, output) {
output$plot <- renderPlot({
plot(cars, col = input$col, cex = 2, pch = 16)
})
})
}
}
|