Notifications from 'Shiny'

Browser notifications in 'Shiny' apps, using 'toastr': < https://github.com/CodeSeven/toastr#readme>.


Project Status: Active - The project has reached a stable, usable state and is being actively developed. Linux Build Status Windows Build status CRAN RStudio mirror downloads

Installation

source("https://install-github.me/mangothecat/shinytoastr")

Usage

Call useToastr() at the beginning of ui definition, and then in the server definition use one of the notification functions, toastr_success(), toastr_info(), toastr_warning() or toastr_error() to create notifications:

library(shinytoastr)
 
ui <- shinyUI(fluidPage(
  useToastr(),
  pageWithSidebar(
    headerPanel("Header"),
    sidebarPanel(
      ...
      actionButton(inputId = "save_button", label = "Save",
                    class = "btn-primary")
      ...
    ),
    mainPanel(
      ...
    )
  )
))
server <- function(input, output, session) {
  ...
  observeEvent(
    input$save_button,
    {
      tryCatch(
        {
          writeToDB(data)
          toastr_success("Saved to database")
        },
        error = function(e) {
          toastr_error(title = "Database error", conditionMessage(e))
        }
      }
    }
  )
}

License

MIT © John Papa, Tim Ferrell, Hans Fjällemark, Mango Solutions.

News

2.1.1

First public release, uses toastr version 2.1.1

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("shinytoastr")

2.1.1 by Gábor Csárdi, 3 years ago


https://github.com/mangothecat/shinytoastr


Report a bug at https://github.com/mangothecat/shinytoastr/issues


Browse source code at https://github.com/cran/shinytoastr


Authors: John Papa , Tim Ferrell , Hans Fjällemark , Gábor Csárdi


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports shiny


See at CRAN