Update a toast in a Shiny application. Run
shinyToastifyExample("toastUpdate")
for an example.
toastUpdate(
session,
toastId,
text,
type = "default",
position = "top-right",
transition = "slide",
autoClose = 5000,
hideProgressBar = FALSE,
closeOnClick = TRUE,
rtl = FALSE,
pauseOnFocusLoss = TRUE,
draggable = TRUE,
draggableDirection = "x",
draggablePercent = 80,
pauseOnHover = TRUE,
className = NULL,
toastClassName = NULL,
bodyClassName = NULL,
progressClassName = NULL,
style = NULL,
JScallback = NULL
)
the Shiny session
object
the id of the toast to be updated (id
argument)
the text displayed in the toast; this can be a character string,
an html element created with the HTML
function, or a shiny.tag
object such as
tags$span(style = "color:lime;", "Message")
toast type, one of "info"
, "success"
,
"warning"
, "error"
, "default"
or "dark"
toast position, one of "top-left"
,
"top-right"
, "top-center"
, "bottom-left"
,
"bottom-right"
or "bottom-center"
the transition effect, one of "slide"
,
"zoom"
, "flip"
or "bounce"
either a number, the time in ms to close the toast, or
FALSE
to close the toast manually
Boolean, whether to hide the progress bar
Boolean, whether to dismiss the toast on click
Boolean, right to left
Boolean, whether to pause the toast on focus loss
Boolean, ability to drag the toast to remove it
"x"
or "y"
the percentage of the width of the toast needed to remove it by dragging
Boolean, whether to pause the toast on hover
name of a CSS class applied to the container
name of a CSS class applied on the toast wrapper
name of a CSS class applied on the toast body
name of a CSS class applied on the progress bar
inline style applied to the container, e.g.
list(boxShadow = "rgba(0, 0, 0, 0.56) 0px 22px 30px 4px")
some JavaScript code given as a string to be executed
whenever the toast is closed; it will have an effect only if the
position
argument differs from the one of the toast to be
updated
No return value, called for side effect.