Need help with shinycssloaders?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

229 Stars 35 Forks Other 112 Commits 8 Opened issues


Add loading animations to a Shiny output while it's recalculating

Services available


Need anything else?

Contributors list

No Data

{shinycssloaders} - Add loading animations to a Shiny output while it's recalculating

CRAN Travis build status

When a Shiny output (such as a plot, table, map, etc.) is recalculating, it remains visible but gets greyed out. Using {shinycssloaders}, you can add a loading animation ("spinner") to outputs instead of greying them out. By wrapping a Shiny output in

, a spinner will automatically appear while the output is recalculating.

You can choose from one of 8 built-in animation types, and customize the colour/size. You can also use your own image instead of the built-in animations. See the demo Shiny app online for examples.

Table of contents


For interactive examples and to see some of the features, check out the demo app.

Below is a simple example of what {shinycssloaders} looks like:

demo GIF

How to use

Simply wrap a Shiny output in a call to

. If you have
loaded, you can use it, for example
plotOutput("myplot") %>% withSpinner()

Basic usage:




To install the stable CRAN version:


To install the latest development version from GitHub:



8 customizable built-in spinners

You can use the

parameter to choose one of the 8 built-in animations, the
parameter to change the spinner's colour, and
to make the spinner smaller or larger (2 will make the spinner twice as large). For example,
withSpinner(plotOutput("myplot"), type = 5, color = "#0dc5c1", size = 2)

Setting spinner parameters globally

If you want all the spinners in your app to have a certain type/size/colour, instead of specifying them in each call to

, you can set them globally using the
R options. For example, setting
will cause all your spinners to use that colour.

Using a custom image

If you don't want to use any of the built-in spinners, you can also provide your own image (either a still image or a GIF) to use instead, using the


Specifying the spinner height

The spinner attempts to automatically figure out the height of the output it replaces, and to vertically center itself. For some outputs (such as tables), the height is unknown, so the spinner will assume the output is 400px tall. If your output is expected to be significantly smaller or larger, you can use the

parameter to adjust this.

Showing a spinner on top of the output

By default, the out-dated output gets hidden while the spinner is showing. You can change this behaviour to have the spinner appear on top of the old output using the

hide.ui = FALSE

Background colour

Spinner types 2 and 3 require you to specify a background colour. It's recommended to use a colour that matches the background colour of the output's container, so that the spinner will "blend in".

Sponsors 🏆

There are no sponsors yet

Become the first sponsor for {shinycssloaders}!


The 8 built-in animations are taken from

The package was originally created by Andrew Sali.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.