djpr_with_spinner: Wrapper around shinycssloaders::withSpinner() with DJPR...

View source: R/djpr_with_spinner.R

djpr_with_spinnerR Documentation

Wrapper around shinycssloaders::withSpinner() with DJPR defaults

Description

This function displays a spinner in place of Shiny UI elements while they are loading / refreshing

Usage

djpr_with_spinner(
  ui_element,
  type = 8,
  colour = "#2A6FA2",
  size = 0.8,
  hide.ui = TRUE,
  ...
)

Arguments

ui_element

An element such as plotOutput()

type

See https://daattali.com/shiny/shinycssloaders-demo

colour

Hex code for spinner

size

Numeric; Size relative to default (1 = default)

hide.ui

Logical. When TRUE, spinner is shown over a blank space; when FALSE, spinner is shown over previously output UI.

...

arguments passed to shinycssloaders::withSpinner()

Details

Use within UI script

Examples

## Not run: 
plotOutput("plot") %>% djpr_with_spinner()

## End(Not run)

djpr-data/djprshiny documentation built on May 14, 2023, 1:15 p.m.