Description Usage Arguments Functions Examples
Programatically show and hide loading screens.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | use_waiter(spinners = NULL, include_js = TRUE)
useWaiter(spinners = NULL, include_js = TRUE)
waiter_use(spinners = 1:7, include_js = TRUE)
waiter_show(
id = NULL,
html = spin_1(),
color = "#333e48",
logo = "",
image = "",
hide_on_render = !is.null(id)
)
waiter_show_on_load(html = spin_1(), color = "#333e48", image = "", logo = "")
waiterShowOnLoad(html = spin_1(), color = "#333e48", image = "", logo = "")
waiter_preloader(
html = spin_1(),
color = "#333e48",
image = "",
fadeout = FALSE,
logo = ""
)
waiterPreloader(
html = spin_1(),
color = "#333e48",
image = "",
fadeout = FALSE,
logo = ""
)
waiter_hide_on_render(id)
waiterHideOnRender(id)
waiter_on_busy(
html = spin_1(),
color = "#333e48",
logo = "",
image = "",
fadeout = FALSE
)
waiterOnBusy(
html = spin_1(),
color = "#333e48",
logo = "",
image = "",
fadeout = FALSE
)
waiter_hide(id = NULL)
waiter_update(id = NULL, html = NULL)
|
spinners |
Deprecated argument. Spinners to include. By default all the CSS files for
all spinners are included you can customise this only that which you
need in order to reduce the amount of CSS that needs to be loaded and
improve page loading speed. There are 7 spinner kits. The spinner kit
required for the spinner you use is printed in the R console when
using the spinner. You can specify a single spinner kit e.g.: |
include_js |
Deprecated argument, no longer needed. |
id |
Id of element to hide or element on which to show waiter over. |
html |
HTML content of waiter, generally a spinner, see |
color |
Background color of loading screen. |
logo |
Path to logo to display. Deprecated. |
image |
Path to background image. |
hide_on_render |
Set to |
fadeout |
Use a fade out effect when the screen is removed. Can be a boolean, or a numeric indicating the number of milliseconds the effect should take. |
use_waiter
and waiter_use
: waiter dependencies to include anywhere in your UI but ideally at the top.
waiter_show_on_load
: Show a waiter on page load, before the session is even loaded, include in UI after use_waiter
.
waiter_show
: Show waiting screen.
waiter_hide
: Hide any waiting screen.
waiter_on_busy
: Automatically shows the waiting screen when the server is busy, and hides it when it goes back to idle.
waiter_update
: Update the content html
of the waiting screen.
waiter_hide_on_render
: Hide any waiting screen when the output is drawn, useful for outputs that take a long time to draw, use in ui
.
waiter_preloader
: Shows the waiter on load and automatically removes it once all the UI is rendered, only runs on the first load of the app.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | library(shiny)
ui <- fluidPage(
useWaiter(), # dependencies
waiterShowOnLoad(spin_fading_circles()), # shows before anything else
actionButton("show", "Show loading for 5 seconds")
)
server <- function(input, output, session){
waiter_hide() # will hide *on_load waiter
observeEvent(input$show, {
waiter_show(
html = tagList(
spin_fading_circles(),
"Loading ..."
)
)
Sys.sleep(3)
waiter_hide()
})
}
if(interactive()) shinyApp(ui, server)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.