bs_offcanvas {bsTools} | R Documentation |
Create a Bootstrap offcanvas
Description
Create a Bootstrap offcanvas
Usage
bs_offcanvas(
id = "offcanvas",
header,
title = NULL,
body,
offcanvas_attr = c(class = "offcanvas offcanvas-start", tabindex = "-1",
`aria-labelledby` = "offcanvasLabel"),
header_attr = c(class = "offcanvas-header"),
title_attr = c(class = "offcanvas-title", id = "offcanvasLabel"),
body_attr = c(class = "offcanvas-body"),
title_function = h5
)
Arguments
id |
A string, the id for the div of the offcanvas. |
header |
A string, the HTML to display in the header of the offcanvas. |
title |
A string, the HTML to display in the title of the offcanvas. |
body |
A string, the HTML to display in the body of the offcanvas. |
offcanvas_attr |
A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the offcanvas content. |
header_attr |
A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the offcanvas header. |
title_attr |
A named list or named vector, names are attribute names and values are attribute values. Added to the tag containing the offcanvas title. |
body_attr |
A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the offcanvas body. |
title_function |
A function, most likely from the html5 package, containing the attr parameter to be used to generate the title, defaults to h5. |
Value
A string of HTML.
Examples
bs_offcanvas(
header = "Hello",
body = p("This is a offcanvas.")
)