Author: David Granjon
Date: 2018-09-20

# CSS preloaders

#### David Granjon

#### 2018-09-20

## How to set up a preloader

Pass the argument `enable_preloader = TRUE` to the `dashboardPagePlus()` function. You can also change the loading duration (2s by default): `loading_duration = 5` for 5 seconds.

    library(shiny)
    library(shinydashboard)
    library(shinydashboardPlus)

    shinyApp(
      ui = dashboardPagePlus(
        enable_preloader = TRUE,
        header = dashboardHeaderPlus(
         enable_rightsidebar = TRUE,
         rightSidebarIcon = "gears"
        ),
        sidebar = dashboardSidebar(),
        body = dashboardBody(),
        rightsidebar = rightSidebar(),
        title = "DashboardPage"
      ),
      server = function(input, output) { }
    )