bs_toast {bsTools} | R Documentation |
Create a Bootstrap toast
Description
Create a Bootstrap toast
Usage
bs_toast(
id,
header,
body,
default_close_button = TRUE,
on_load = TRUE,
toast_attr = c(class = "toast", role = "alert", `aria-live` = "assertive",
`aria-atomic` = "true", `data-bs-autohide` = "false"),
header_attr = c(class = "toast-header"),
body_attr = c(class = "toast-body")
)
Arguments
id |
A string, the id for the div of the toast. |
header |
A string, the HTML to display in the header of the toast. |
body |
A string, the HTML to display in the body of the toast. |
default_close_button |
TRUE/FALSE, if TRUE, adds code to display the default toast close button, otherwise the close button should be added manually. |
on_load |
TRUE/FALSE, if TRUE, adds a script tag with javascript to show the toast by id on load. |
toast_attr |
A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the toast content. |
header_attr |
A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the toast header. |
body_attr |
A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the toast body. |
Value
A string of HTML.
Examples
bs_toast(
id = "toast1",
header = "Hello",
body = "This is a toast"
)