useAlertify {standby} | R Documentation |
Alertify
Description
Pretty browser alerts and notifications.
Usage
useAlertify()
alertify_alert(
title = "Alert Title",
message = "Alert Message",
type = "success",
btn_label = "OK",
transition = "pulse",
transition_off = FALSE,
closable = TRUE,
auto_reset = FALSE,
frameless = FALSE,
maximizable = FALSE,
modal = FALSE,
movable = FALSE,
move_bounded = TRUE,
overflow = FALSE,
padding = TRUE,
pinnable = FALSE,
resizeable = FALSE,
start_maximized = FALSE,
session = getDefaultReactiveDomain()
)
alertify_notify(
message = "Alert Message",
type = "success",
delay = 5,
position = "bottom-right",
session = getDefaultReactiveDomain()
)
Arguments
title |
Dialog title. |
message |
Dialog contents. |
type |
Dialog type. Defaults to
|
btn_label |
The |
transition |
Transition effect to be used when showing/hiding the dialog. Defaults to
|
transition_off |
Logical; if |
closable |
Logical; if |
auto_reset |
Logical; if |
frameless |
Logical; if |
maximizable |
Logical; if |
modal |
Logical; if |
movable |
Logical; if |
move_bounded |
Logical; if |
overflow |
Logical; if |
padding |
Logical; if |
pinnable |
Logical; if |
resizeable |
Logical; if |
start_maximized |
Logical; if |
session |
Shiny session object. |
delay |
The time (in seconds) to wait before the notification is auto-dismissed. |
position |
Position of the notification. Defaults to
|
Value
None
Functions
-
useAlertify
: Dependencies to include in your UI. -
alertify_alert
: Display alerts. -
alertify_notify
: Display notifications.
Examples
# Example 1: Alert
if (interactive()) {
library(shiny)
library(standby)
ui <- fluidPage(
useAlertify(), # include dependencies
actionButton(inputId = "btn",
label = "Alert Demo")
)
server <- function(input, output, session) {
observeEvent(input$btn, {
# display alert
alertify_alert("Hey there!", "Thank you for exploring standby!")
})
}
shinyApp(ui, server)
}
# Example 2: Notification
if (interactive()) {
library(shiny)
library(standby)
ui <- fluidPage(
useAlertify(), # include dependencies
actionButton(inputId = "btn",
label = "Notification Demo")
)
server <- function(input, output, session) {
observeEvent(input$btn, {
# display notification
alertify_notify("Hey there! Thank you for exploring standby!")
})
}
shinyApp(ui, server)
}