A popover can be a useful way to add a somewhat-verbose explanation to a tag.
bs_embed_popover(tag, title = NULL, content = NULL, placement = "top", ...) use_bs_popover()
tag |
|
---|---|
title | character, title for the popover, generally text |
content | character, content for the popover body, can be HTML |
placement | character, placement of the popover with respect to |
... | other named arguments, passed to |
htmltools::[tag][htmltools::tag]
, modified copy of tag
To activate the use of popovers in your page, you will need to call
the use_bs_popover()
function somewhere.
The verb embed is used to signify that you are embedding information
into a tag
. This implies that you can embed, at most, one "thing"
into a particular tag
. You should not, for example, expect to embed both a tooltip
and a popover into a tag
.
library("htmltools") bs_button("A button") %>% bs_embed_popover(title = "I'm a popover", content = "Really!")#> <button class="btn btn-default" title="I'm a popover" data-toggle="popover" data-content="Really!" data-placement="top">A button</button>