shinybiocloader: CSS loader for shiny apps

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.5.2 (2025-10-31)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        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: Etc/UTC
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.5.2    fastmap_1.2.0     cli_3.6.5         htmltools_0.5.8.1
 [5] tools_4.5.2       yaml_2.3.10       maketools_1.3.2   buildtools_1.0.0 
 [9] rmarkdown_2.30    knitr_1.50        jsonlite_2.0.0    digest_0.6.38    
[13] xfun_0.54         rlang_1.1.6       sys_3.4.3         evaluate_1.0.5