bs_set_data | R Documentation |
Helper function to manage attributes for Bootstrap's JavaScript components.
bs_set_data(tag, ...) bs_set_aria(tag, ...)
tag |
|
... |
named arguments used to set the attributes of |
One of the mechanisms used by the API for Boostrap JavaScript-components is
an html elements' attributes. These attribute names are prefixed with
"data-"
or "aria-"
, depending on the function.
When expressed in html, attributes themselves have the properties:
Logical values are expressed as "true"
or "false"
.
Time durations are expressed as number of milliseconds.
Vector (non scalar) values are expressed in a space-delimited list.
The purpose of this function is to let you express these values in ways familiar to you as an R user. For example:
Logical values can be expressed as logicals: TRUE
or FALSE
.
Time durations can be expressed using lubridate durations.
Vector (non scalar) values can be expressed as vectors.
Note that this returns a modified copy of the tag sent to it, so it is pipeable.
htmltools::[tag][htmltools::tag]
, modified copy of tag
Bootstrap JavaScript Components
library("htmltools") library("lubridate") tags$div() %>% bs_set_data( target = "#foobar", delay = dseconds(1), placement = c("right", "auto") ) %>% bs_set_aria(expanded = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.