Busy indicator for shiny apps

library(shinybusy)

{shinybusy} allow to add global indicators to a {shiny} application to show the user that application is busy (something is happening server-side). There is three main type of indicators :

Automatic indicators

The indicator will be displayed each time a calculation take more than the timeout defined (default to 1000ms), you don’t have to intervene in the server.

Three indicators are available :

# Add in UI
add_busy_spinner(spin = "fading-circle")

add_busy_bar(color = "red", height = "8px")

# Add in UI
add_busy_gif(
  src = "https://jeroen.github.io/images/banana.gif",
  height = 70, width = 70
)

Manual indicators

The same types of indicators are available than for automatic indicators, but this time functions starts with use_* and you have to explicitly trigger the indicator server-side.

# in UI
use_busy_spinner(spin = "fading-circle")

# in server
show_spinner() # show the spinner
hide_spinner() # hide the spinner
# in UI
use_busy_bar(color = "#01DF01", height = "15px")

# in server
update_busy_bar(0) # update with the desire value [0-100], 100 hide the bar
# in UI
use_busy_gif(
  src = "https://jeroen.github.io/images/banana.gif",
  height = 70, width = 70
)

# in server
play_gif() # play animation
stop_gif() # stop animation

Full-page loading indicator

Cover the whole page with a loading indicator from the server, using the Loading module of Notiflix. Unlike modals, the indicator is not a Shiny modal window and is shared by all modules in the app. To cover a single element, see block().

# in server
show_loading("Calculating...", type = "circle") # show the indicator
update_loading("Almost done...") # change its text
remove_loading() # remove it when done

Use remove_loading(timeout = 500) to remove the indicator after a delay in milliseconds.

Notifications

Show notifications and reports to user through JavaScript library Notiflix. Four appearance are available: success, failure, info and warning. Notifications are fully configurable.

# success notification
notify_success("Well done!")

# report failure
report_failure(
  "Oups...",
  "Something went wrong"
)