shinybiocloader: CSS loader for shiny apps

Marcel Ramos

2026-04-28

shinybiocloader

This package is intended for shiny app developers. It provides a simple way to add a loading animation to a shiny application when processing data or rendering outputs.

Installation

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("shinybiocloader")

Usage

You can use the withLoader function to wrap any UI element that you want to display a loader for. The loader can be specified by its name, such as “biocspin” though there is only one loader in the package currently.

library(shiny)
library(shinybiocloader)
ui <- fluidPage(
    titlePanel("shinybiocloader demo"),
    sidebarLayout(
        sidebarPanel(
            actionButton("load_data", "Load Data")
        ),
        mainPanel(
            withLoader(
                plotOutput("plot"), loader = "biocspin"
            )
        )
    )
)
server <- function(input, output) {
    observeEvent(input$load_data, {
        output$plot <- renderPlot({
            hist(rnorm(1000), main = "Random Normal Distribution")
        })
    })
}
shinyApp(ui = ui, server = server)

Session Information

sessionInfo()
R version 4.6.0 Patched (2026-05-01 r89994)
Platform: aarch64-apple-darwin23
Running under: macOS Tahoe 26.3.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1

locale:
[1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_4.6.0  fastmap_1.2.0   cli_3.6.6       tools_4.6.0    
 [5] htmltools_0.5.9 otel_0.2.0      yaml_2.3.12     rmarkdown_2.31 
 [9] knitr_1.51      jsonlite_2.0.0  xfun_0.57       digest_0.6.39  
[13] rlang_1.2.0     png_0.1-9       evaluate_1.0.5