shinybiocloader: CSS loader for shiny apps

Marcel Ramos

2026-04-15

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 RC (2026-04-17 r89917)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.4 LTS

Matrix products: default
BLAS:   /home/biocbuild/bbs-3.24-bioc/R/lib/libRblas.so 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_GB              LC_COLLATE=C              
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: America/New_York
tzcode source: system (glibc)

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