[This article was first published on Rsquared Academy Blog - Explore Discover Learn, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)


Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.We are excited to announce the standby package. It allows you to easily create alerts, notifications, tooltips and loading screens in Shiny. The package was developed as part of our internal tools for developing shiny apps and we are glad to share it with the rest of the community.

Installation ```

Install release version from CRANinstall.packages("standby")# Install development version from GitHub# install.packages("devtools")devtools::install_github("rsquaredacademy/standby")

``` Loading ScreensTo use spinners/loaders from standby in your Shiny application, include thefollowing 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) hist(mtcars$mpg) })}shinyApp(ui, server) DetailsThe below table displays the dependency and rendering functions along with references:

| Index | Dependency | Render | Reference | | --- | --- | --- | --- | | 1 | useThreeDots() | threeDots() | Three Dots | | 2 | useSpinkit() | spinkit() | SpinKit | | 3 | useVizLoad() | vizLoad() | Loading Visualization | | 4 | useSpinners() | spinners() | Spinners | | 5 | useLoaders() | loaders() | Loaders |

Alerts and NotificationsTo 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 appropriateuse* functions (useToast() in the below example).
  • Include the corresponding rendering function in the Server part of theapp (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) DetailsThe below table displays the dependency and rendering functions along with references:

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

Learning More* Documentation * GitHub Inspiration & Acknowledgementstandby takes inspiration from the following wonderful packages:

  • shinycssloaders by Dean Attali
  • waiter by John Coene

We found the following books extremely helpful while working on the package and in general for developing Shiny apps. We would like to express out heartful gratitude to the respective authors for making them available for free to the community.

  • Outstanding User Interfaces with Shiny byDavid Granjon
  • JavaScript for R by John Coene Getting HelpIf you encounter a bug, please file a minimal reproducible example usingreprex on github. For questions and clarifications,use StackOverflow.

FeedbackAll feedback is welcome. Issues (bugs and feature requests) can be posted togithub tracker.For help with code or other related questions, feel free to reach out to usat pkgs@rsquaredacademy.com.

To leave a comment for the author, please follow the link and comment on their blog: Rsquared Academy Blog - Explore Discover Learn.


R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.


Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.Continue reading: Introducing standby