Skip to main content

Spinners

Usage

Definition

Spinners are a visual element used by `Interstitials` to indicate a pending state. Typically this is used when first rendering a component which relies on fetching data from an outside source.

Common Characteristcs

A spinner is a visual element used to indicate a pending state. Typically this is used when first rendering a component which relies on fetching data from an external source.

Usage Guidelines

  • Spinner should be used when an interface is not immediately available.
  • Spinners provide a visual indication that something is happening.
  • Typically, a Spinner will be displayed until data becomes available or when an error is encountered.
  • The Interstitial component provides a best-practice implementation of this pattern and is recommended when using the Prism library in you app.

Code

Default Spinner

Live Editor
Result
Loading...

Spinner Color

Set the color of a spinner - accepts Bootstrap utility classes or CSS Hex colors as a string. This does not support named CSS colors or rgb(a) values.

Live Editor
Result
Loading...

Color Options

We recommend using Bootstrap utility classes for consistent colors before resorting to CSS Hex colors. The default theme for Prism includes the following color mappings:

Bootstrap Color NameHex
primary#ffc20e
secondary#005ba8
success#0d8240
danger#c33a00
info#2c90cc
warning#eb9114

Spinner Sizes

You can adjust the dimensions of a spinner using the size prop. It accepts any valid CSS Dimension but we recommend using Bootstrap utility names where possible (sm, lg, xl etc.).

Live Editor
Result
Loading...

Size Options

Note: In order to consistently center the spinner, numerical size arguments must be an odd number. Even values will be rendered 1px smaller than indicated in order to calculate the center correctly.

SizeRendered Height
xs15px
sm19px
md25px
lg33px
xl47px
xxl47px
"74px"73px
2019px

Spinner Props

NameTypeDefaultDescription
sizestring,number (odd only)mdSize of spinner*
colorstring#000000Fill color of spinner