useToast {standby} | R Documentation |
iziToast
Description
Lightweight toast notifications
Usage
useToast()
toast(
title = "Hey",
message = NULL,
type = NULL,
theme = NULL,
position = "center",
duration = 5000,
progress_bar_color = NULL,
background_color = NULL,
max_width = NULL,
title_color = NULL,
title_size = NULL,
title_line_height = NULL,
message_color = NULL,
message_size = NULL,
message_line_height = NULL,
image = NULL,
image_width = NULL,
zindex = 99999,
layout = 1,
balloon = FALSE,
close = TRUE,
close_on_escape = FALSE,
close_on_click = FALSE,
rtl = FALSE,
display_mode = 0,
drag_to_close = TRUE,
pause_on_hover = TRUE,
reset_on_hover = FALSE,
progress_bar_easing = "linear",
overlay = FALSE,
overlay_close = FALSE,
overlay_color = "rgba(0, 0, 0, 0.6)",
animate_inside = TRUE,
transition_in = "fadeInUp",
transition_out = "fadeOut",
session = getDefaultReactiveDomain()
)
Arguments
title |
Title of the toast. |
message |
Message of toast. |
type |
Type of notification. Defaults to
|
theme |
Theme of toast. Choose between |
position |
Where toast will be shown. Defaults to
|
duration |
Time in milliseconds to close the toast. Defaults to |
progress_bar_color |
Progress bar color. Choose between hexadecimal, RGB or keyword values. |
background_color |
Background color of the toast. Choose between hexadecimal, RGB or keyword values. |
max_width |
Maximum width of the toast. |
title_color |
Title color. Choose between hexadecimal, RGB or keyword values. |
title_size |
Title font size. |
title_line_height |
Title line height. |
message_color |
Message color. Choose between hexadecimal, RGB or keyword values. |
message_size |
Message font size. |
message_line_height |
Message line height. |
image |
Cover image. |
image_width |
Width of cover image. Defaults to |
zindex |
The z-index CSS attribute of the toast. Defaults to |
layout |
Size of the toast. Choose between |
balloon |
Logical; if |
close |
Logical; if |
close_on_escape |
Logical; if |
close_on_click |
Logical; if |
rtl |
Logical; if |
display_mode |
Rules to show multiple toasts. Default is
|
drag_to_close |
Logical; if |
pause_on_hover |
Logical; if |
reset_on_hover |
Logical; if |
progress_bar_easing |
Animation easing of progress bar. Defaults to |
overlay |
Logical; if |
overlay_close |
Logical; if |
overlay_color |
Overlay background color. Defaults to |
animate_inside |
Logical; if |
transition_in |
Toast open animation. Defaults to
|
transition_out |
Toast close animation. Defaults to
|
session |
Shiny session object. |
Value
None
Functions
-
useToast
: Dependencies to include in your UI. -
toast
: Display toast notifications.
Examples
if (interactive()) {
library(shiny)
library(standby)
ui <- fluidPage(
useToast(), # include dependencies
actionButton(inputId = "btn",
label = "iziToast Demo")
)
server <- function(input, output, session) {
observeEvent(input$btn, {
# display toast notification
toast("Hey there!", "Thank you for exploring standby!")
})
}
shinyApp(ui, server)
}