The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

CSS preloaders

David Granjon

2024-04-10

How to set up a preloader?

Pass the argument preloader to the dashboardPage() function. It expects a nested list containing all parameters necessary to waiter::waiterShowOnLoad. Please have a look to the {waiter} documentation for more details.

That’s all!

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
library(waiter)
shinyApp(
  ui = dashboardPage(
    preloader = list(html = tagList(spin_1(), "Loading ..."), color = "#3c8dbc"),
    header = dashboardHeader(),
    sidebar = dashboardSidebar(),
    body = dashboardBody(
      actionButton("reload", "Reload")
    ),
    title = "Preloader"
  ),
  server = function(input, output, session) {
    # fake reload
    observeEvent(input$reload, {
      session$reload()
    })
  }
)

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.