Description Usage Arguments Examples
A notyf is a simple notification that contains a message and an icon. The message, icon, duration, color, and ripple effect can all be modified. There is an additional parameter type that can be used as a shortcut to display a custom, success, or error notification.
1 2 | shinynotyf(message, type = "custom", duration = NULL,
color = "#0a84ff", ripple = FALSE, icon = "face")
|
message |
Message to display in the notification. |
type |
Type of notification to display, one of custom, success, or error. Defaults to custom. |
duration |
Duration of the notification. |
color |
Backgroun color of the notification. |
ripple |
Enables ripple animation, defaults to FALSE. |
icon |
Material icon to be used, defaults to 'face'. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | if (interactive()) {
library(shiny)
library(shinynotyf)
shinyApp(
ui = fluidPage(
# Set up shinynotyf
use_shinynotyf(),
actionButton("btn", "Click me")
),
server = function(input, output) {
observeEvent(input$btn, {
# Show a simple notification
shinynotyf(message = "You did it!", type = "success")
})
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.