Decorates an existing tag with the data attributes Bootstrap needs to render
a tooltip. Tooltips are initialised client-side by bootstrict (Bootstrap does
not auto-initialise them). A tag that is already a data-API trigger — a
bs_modal_trigger(), bs_offcanvas_trigger(), bs_collapse_trigger() or a
dropdown toggle — keeps its own data-bs-toggle; the tooltip works
alongside it.
Arguments
- tag
A UI element (a
shiny.tag) to attach the tooltip to.- title
Tooltip text (or HTML, when
html = TRUE).- ...
Extra named attributes applied to
tag.- placement
Tooltip placement:
"auto","top","right","bottom"or"left".- html
If
TRUE, allow HTML content in the tooltip (data-bs-html).- trigger
How the tooltip is triggered (e.g.
"hover focus","click","manual");NULLuses the Bootstrap default.
Examples
bs_tooltip(shiny::tags$button("Hover me"), "Tooltip text")
#> <button data-bs-toggle="tooltip" data-bs-title="Tooltip text" data-bs-placement="top" data-bootstrict-tip="tooltip">Hover me</button>