use_shinynotyf: Set up a Shiny app to use shinynotyf

Description Usage Value See Also Examples

View source: R/shinynotyf.R

Description

This function must be called from a Shiny app's UI in order for the shinynotyf function to work.

You can call use_shinynotyf() from anywhere inside the UI.

Usage

1

Value

Scripts that shinynotyf requires that are automatically inserted to the app's <head> tag.

See Also

shinynotyf

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.