Learn R Programming

standby

Easily create alerts, notifications, tooltips and loading screens in Shiny

Installation

You can install the development version of standby from GitHub with:

# install.packages("devtools")
devtools::install_github("rsquaredacademy/standby")

Usage

Loading Screens

To use spinners/loaders from standby in your Shiny application, include the following in the UI part of the app:

  • Include the dependencies using the appropriate use* functions (useSpinkit() in the below example).
  • Wrap the target output using corresponding rendering function (spinkit() in the below example).
Example
library(shiny)
library(standby)

ui <- fluidPage(

  standby::useSpinkit(), # include dependencies
  fluidRow(
    standby::spinkit(plotOutput("plot1")), # wrap output inside loader
    actionButton("render", "Render")
  )

)

server <- function(input, output, session) {

    output$plot1 <- renderPlot({
      input$render
      Sys.sleep(3)
      plot(cars)
    })

}

shinyApp(ui, server)

Details

The below table displays the dependency and rendering functions along with references:

IndexDependencyRenderReference
1useThreeDots()threeDots()Three Dots
2useSpinkit()spinkit()SpinKit
3useVizLoad()vizLoad()Loading Visualization
4useSpinners()spinners()Spinners
5useLoaders()loaders()Loaders

Alerts and Notifications

To use alerts or notifications from buzz in your Shiny application, follow the below steps:

  • Include the dependencies in the UI part of the app using the appropriate use* functions (useToast() in the below example).
  • Include the corresponding rendering function in the Server part of the app (toast() in the below example).
Example
library(shiny)
library(standby)
ui <- fluidPage(
  useBootBox(), # include dependencies
  actionButton(inputId = "notify",
               label   = "Show Notification")
)
server <- function(input, output, session) {
  observeEvent(input$pnotify, {
    bootBox(class = "rubberBand") # display the alert
  })
}
shinyApp(ui, server)

Details

The below table displays the dependency and rendering functions along with references:

IndexDependencyRenderReference
1useAlertify()alertify_alert()Alertify
2useAlertify()alertify_notify()Alertify
3useBootBox()bootBox()BootBox
4useMicroTip()microTip()MicroTip
5useNS()notice()Notification Styles
6useNotify()notify()PNotify
7useTingle()tingle()Tingle
8useToast()toast()iziToast

Getting Help

If you encounter a bug, please file a minimal reproducible example using reprex on github. For questions and clarifications, use StackOverflow.

Code of Conduct

Please note that the standby project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Copy Link

Version

Install

install.packages('standby')

Monthly Downloads

674

Version

0.1.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Aravind Hebbali

Last Published

May 24th, 2023

Functions in standby (0.1.0)

useToast

iziToast
useAlertify

Alertify
preview

Preview Alerts
useNotify

PNotify
useNS

Notification Styles
useLoaders

CSS Loaders
useBootBox

BootBox
useSpinners

Single Element CSS Spinners
useMicroTip

MicroTip
useSpinkit

SpinKit
standby

standby package
useTingle

Tingle
useThreeDots

Three Dots
standbyDeps

standby dependencies
useVizLoad

Loading Visualization