shinynotyf: Display a notification message (notyf) in Shiny

Description Usage Arguments Examples

View source: R/shinynotyf.R

Description

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.

Usage

1
2
shinynotyf(message, type = "custom", duration = NULL,
  color = "#0a84ff", ripple = FALSE, icon = "face")

Arguments

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'.

Examples

 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")
      })
    }
  )
}

tyluRp/shinynotyf documentation built on Jan. 13, 2020, 12:26 a.m.