Package 'shinybiocloader'

Title: Use a Shiny Bioconductor CSS loader
Description: Add a Bioconductor themed CSS loader to your shiny app. It is based on the shinycustomloader R package. Use a spinning Bioconductor note loader to enhance your shiny app loading screen. This package is intended for developer use.
Authors: Marcel Ramos [aut, cre] (ORCID: <https://orcid.org/0000-0002-3242-0582>)
Maintainer: Marcel Ramos <[email protected]>
License: Artistic-2.0
Version: 1.3.0
Built: 2026-05-30 09:46:57 UTC
Source: https://github.com/bioc/shinybiocloader

Help Index


Add a loader to a Shiny UI element

Description

Add a loader to a Shiny UI element

Usage

withLoader(ui_element, loader = "biocspin", proxy.height = "400px")

Arguments

ui_element

A Shiny UI element (e.g., uiOutput, plotOutput, etc.) for which to wrap with the loader.

loader

character(1) A string specifying the loader type. Default is "biocspin".

proxy.height

character(1) A string specifying the height of the proxy element. Default is "400px". If the ui_element already has a height specified, this will be set to "100%".

Value

A Shiny UI element wrapped with the Bioconductor loader

References

shinycustomloader https://github.com/emitanaka/shinycustomloader

⁠dna spin⁠ https://codepen.io/knut/pen/ZopMWW

Examples

library(shiny)
library(shinydashboard)
library(shinybiocloader)

waitHist <- function() {
  waiting <- faithful[["waiting"]]
  Sys.sleep(3)  # Simulate loading
  hist(
    waiting, col = 'darkgray', border = 'white',
    main = 'Old Faithful Geyser Waiting Times Histogram',
    xlab = 'Waiting Time (min)'
  )
}

ui <- dashboardPage(
  dashboardHeader(title = "Bioconductor Loader"),
  dashboardSidebar(disable = TRUE),
  dashboardBody(
    h2("Bioconductor Spinning Loader"),
    HTML(
      paste0(
        "<pre><code class='language-r'>",
        "withLoader(plotOutput('distPlot'), loader='biocspin')",
        "</code></pre>"
      )
    ),
    fluidRow(
      box(
        title = "With Loader", status = "primary", solidHeader = TRUE,
        withLoader(plotOutput("distPlot"), loader = "biocspin")
      ),
      box(
        title = "Without Loader", status = "warning", solidHeader = TRUE,
        plotOutput("distPlot2")
      )
    )
  )
)

server <- function(input, output) {
  output$distPlot <- renderPlot(waitHist())
  output$distPlot2 <- renderPlot(waitHist())
}

shinyApp(ui = ui, server = server)