bs_toast | R Documentation |
Create a Bootstrap toast
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") )
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. |
A string of HTML.
bs_toast( id = "toast1", header = "Hello", body = "This is a toast" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.