Description Usage Arguments Examples
Initialize with use_noty
in UI before using noty
server-side.
Close all notifications with noty_close
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | noty(
text,
timeout = getOption("noty.timeout", default = 2000),
type = c("info", "alert", "success", "error", "warning"),
layout = c("topRight", "top", "topLeft", "topCenter", "center", "centerLeft",
"centerRight", "bottom", "bottomLeft", "bottomCenter", "bottomRight"),
theme = getOption("noty.theme", default = "sunset"),
modal = FALSE,
killer = FALSE,
animation_open = NULL,
animation_close = NULL,
session = shiny::getDefaultReactiveDomain()
)
noty_close(session = shiny::getDefaultReactiveDomain())
use_noty(maxVisible = 5)
|
text |
Text to display. |
timeout |
Delay for closing notification in milliseconds (ms).
Set |
type |
Type of notification: |
layout |
Position among : |
theme |
Theme to use between : |
modal |
Add an overlay to the page to emphasis notification. |
killer |
Close all others notification before opening. |
animation_open, animation_close |
Animation effect, use |
session |
Shiny session. |
maxVisible |
Maximum number of notifications that can appear at a time. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | library(shiny)
library(shinypop)
ui <- fluidPage(
tags$h2("noty example"),
use_noty(),
radioButtons(
inputId = "type",
label = "Type:",
choices = c("info", "alert",
"success", "error",
"warning"),
inline = TRUE
),
radioButtons(
inputId = "layout",
label = "Layout:",
choices = c("topRight", "top",
"topLeft", "topCenter",
"center", "centerLeft",
"centerRight", "bottom",
"bottomLeft", "bottomCenter",
"bottomRight"),
inline = TRUE
),
radioButtons(
inputId = "theme",
label = "Theme:",
choices = c("mint", "sunset",
"relax", "nest",
"metroui", "semanticui",
"light", "bootstrap-v3",
"bootstrap-v4"),
inline = TRUE
),
checkboxInput(
inputId = "killer",
label = "Killer",
value = FALSE
),
checkboxInput(
inputId = "modal",
label = "Modal",
value = FALSE
),
actionButton(
inputId = "show",
label = "Show notification",
width = "100%"
)
)
server <- function(input, output, session) {
observeEvent(input$show, {
noty(
text = "Hello world!",
type = input$type,
layout = input$layout,
theme = input$theme,
modal = input$modal,
killer = input$killer
)
})
}
if (interactive())
shinyApp(ui, server)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.