vignettes/shiny_help_links.Rmd
shiny_help_links.Rmd
Let’s consider a shiny input. One way to put unobtrusive help into a shiny input is to embed a help icon into its label, having associated the help icon with the help documentation. This suggests three steps:
shiny::icon()
or
shiny_iconlink()
(which simply wraps the icon in an HTML
link).bs_embed_tooltip()
, bs_embed_popover()
or
bs_attach_modal()
.shinyInput_label_embed()
.Here’s an example of everything put together:
selectInput(
inputId = "letter",
label = "Label with popover help",
choices = c("a", "b", "c")
) %>%
shinyInput_label_embed(
shiny_iconlink() %>%
bs_embed_popover(
title = "Letter", content = "Choose a favorite", placement = "left"
)
)
As of writing, I don’t know how to include operable shiny inputs in an html document, outside of the shiny runtime. To see these functions in action, you can refer to this shiny app, which you can also run locally using:
shiny::runApp(system.file("shiny", "tooltip_popover_modal", package = "bsplus"))
To promote consistency, the following convention is proposed:
shiny::icon("info-circle")
, the default for
shiny_iconlink()
.shiny::icon("info")
.