useNotify {standby} | R Documentation |
PNotify
Description
Beautiful notifications and prompts.
Usage
useNotify()
notify(
title = "Hey",
text = NULL,
type = "notice",
icon = TRUE,
delay = 8000,
hide = TRUE,
sticker = TRUE,
closer = TRUE,
shadow = TRUE,
mouse_reset = TRUE,
animation = "fade",
animate_speed = "normal",
width = "360px",
min_height = "16px",
max_text_height = "200px",
translucent = FALSE,
non_blocking = FALSE,
session = getDefaultReactiveDomain()
)
Arguments
title |
Title of the notice. It can be a string, an element or |
text |
Text of the notice. It can be a string, an element or |
type |
Type of notice. Defaults to
|
icon |
Logical; if |
delay |
Delay in milliseconds before the notice is removed. If set to |
hide |
Logical; if |
sticker |
Logical; if |
closer |
Logical; if |
shadow |
Logical; if |
mouse_reset |
Logical; if |
animation |
The animation to be used while displaying and hiding the notice. |
animate_speed |
Speed at which the notice animates in and out. Valid values are:
|
width |
Width of the notice. Default is |
min_height |
Minimum height of the notice. Default is |
max_text_height |
Maximum height of the text container. Default is |
translucent |
Logical; if |
non_blocking |
Logical; if |
session |
Shiny session object. |
Value
None
Functions
-
useNotify
: Dependencies to include in your UI. -
notify
: Display notifications.
Examples
if (interactive()) {
library(shiny)
library(standby)
ui <- fluidPage(
useNotify(), # include dependencies
actionButton(inputId = "btn",
label = "PNotify Demo")
)
server <- function(input, output, session) {
observeEvent(input$btn, {
# display notification
notify("Hey there!", "Thank you for exploring standby!")
})
}
shinyApp(ui, server)
}