Create a Bootstrap offcanvas
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
)
A string of HTML.
A string, the id for the div of the offcanvas.
A string, the HTML to display in the header of the offcanvas.
A string, the HTML to display in the title of the offcanvas.
A string, the HTML to display in the body of the offcanvas.
A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the offcanvas content.
A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the offcanvas header.
A named list or named vector, names are attribute names and values are attribute values. Added to the tag containing the offcanvas title.
A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the offcanvas body.
A function, most likely from the html5 package, containing the attr parameter to be used to generate the title, defaults to h5.
bs_offcanvas(
header = "Hello",
body = p("This is a offcanvas.")
)
Run the code above in your browser using DataLab