Type: | Package |
Title: | Add Tooltips in 'Shiny' Apps with 'Hint.css' |
Version: | 1.2.1 |
Description: | In 'Shiny' apps, it is sometimes useful to store information on a particular item in a tooltip. 'Prompter' allows you to easily create such tooltips, using 'Hint.css'. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
Imports: | shiny |
Suggests: | htmltools, spelling, testthat |
RoxygenNote: | 7.1.2 |
URL: | https://prompter.etiennebacher.com, https://github.com/etiennebacher/prompter |
BugReports: | https://github.com/etiennebacher/prompter/issues |
Language: | en-US |
NeedsCompilation: | no |
Packaged: | 2025-07-01 07:59:57 UTC; etienne |
Author: | Etienne Bacher [aut, cre, cph] |
Maintainer: | Etienne Bacher <etienne.bacher@protonmail.com> |
Repository: | CRAN |
Date/Publication: | 2025-07-01 08:50:02 UTC |
Add a tooltip for a specific element
Description
Add a tooltip for a specific element
Usage
add_prompt(
ui_element,
position = "bottom",
message = NULL,
type = NULL,
size = NULL,
permanent = FALSE,
rounded = FALSE,
animate = TRUE,
bounce = FALSE,
arrow = TRUE,
shadow = TRUE
)
Arguments
ui_element |
Element on which a tooltip will be added. |
position |
Position of the tooltip. Can be 'bottom', 'bottom-left', 'bottom-right', 'left', 'right', 'top', 'top-left', 'top-right'. Default is 'bottom'. |
message |
Message to include in the tooltip. This argument is mandatory. |
type |
Type of the tooltip. Can be 'NULL' (default), 'error', 'warning', 'info', 'success'. |
size |
Size of the tooltip. Can be 'NULL' (default), 'small', 'medium', 'large'. |
permanent |
Boolean indicating whether the tooltip should be visible permanently (or at the contrary only when hovering the element). Default is 'FALSE'. |
rounded |
Boolean indicating whether the corners of the tooltip should be rounded. Default is 'FALSE'. |
animate |
Boolean indicating whether there is a small animation when the tooltip appears. Default is 'TRUE'. |
bounce |
Boolean indicating whether there is a small boucing animation when the tooltip appears. Default is 'FALSE'. |
arrow |
Boolean indicating whether there is an arrow on the tooltip. Default is 'TRUE'. |
shadow |
Boolean indicating whether there should be a shadow effect. Default is 'TRUE'. |
Value
A tooltip when hovering the element concerned.
Examples
if (interactive()) {
library(shiny)
ui <- fluidPage(
use_prompt(),
add_prompt(
tableOutput("table"),
position = "bottom", type = "warning",
message = "this is a table", permanent = FALSE,
rounded = TRUE, animate = FALSE
)
# also works with magrittr's pipe
# tableOutput("table") %>%
# add_prompt(
# position = "bottom", type = "warning",
# message = "this is a button", permanent = FALSE,
# rounded = TRUE, animate = FALSE
# )
)
server <- function(input, output, session) {
output$table <- renderTable(head(mtcars))
}
shinyApp(ui, server)
}
Load hint.css dependencies
Description
Load hint.css dependencies
Usage
use_prompt()
Value
Include dependencies of Hint.css