- ...
Body content of the toast. Can be a string, or any HTML elements.
Named arguments will be treated as HTML attributes for the toast container.
- header
Optional header content. Can be a string, or the result of
toast_header(). If provided, creates a .toast-header with close button
(if closable = TRUE).
- icon
Optional icon element, for example from shiny::icon(),
bsicons::bs_icon() or fontawesome::fa().
- id
Optional unique identifier for the toast. If NULL, an ID will be
automatically generated when the toast is shown via show_toast().
Providing a stable ID allows you to hide the toast later. If a toast with
id is already visible, that toast is automatically hidden before showing
the new toast with the same id so that only one toast with a given ID is
shown at once.
- type
Optional semantic type. One of NULL, "primary",
"secondary", "success", "info", "warning", "danger", "light",
or "dark". Applies appropriate Bootstrap background utility classes
(text-bg-*).
- duration_s
Numeric. Number of seconds after which the toast should
automatically hide. Use 0, or NA to disable auto-hiding (toast will
remain visible until manually dismissed). Default is 5 (5 seconds).
- position
String or character vector specifying where to position the
toast container. Can be provided in several formats:
Kebab-case: "top-left", "bottom-right", etc.
Space-separated: "top left", "bottom right", etc.
Character vector: c("top", "left"), c("bottom", "right"), etc.
Any order: "left top" is equivalent to "top left"
Valid vertical positions are "top", "middle", or "bottom". Valid
horizontal positions are "left", "center", or "right". Input is
case-insensitive. Default is "bottom-right".
- closable
Logical. Whether to include a close button. Defaults to
TRUE. When both duration_s = NA (or 0 or NULL) and closable = FALSE, the toast will remain visible until manually hidden via
hide_toast(). This is useful when the toast contains interactive Shiny UI
elements and you want to manage the toast display programmatically.
- title
Header text (required).
- status
Optional status text that appears as small, muted text on the
right side of the header.