Spinner

July 15, 2018 ยท View on GitHub

Circular progress indicator.

Available themed spinners:

  • Indeterminate spinners:
    • MaterialDesignSpinner
    • IOSSpinner
  • Determinate spinner:
    • MaterialDesignProgressSpinner

Main features

  • Conditionally show spinner
  • Set size
  • Create a FAB-like appearance with shadow and whitespace; set z-depth
  • Material Design / iOS spinner: set color
  • Progress spinner: set percentage
  • Progress spinner: animate between steps; set update duration

Usage

Options

Spinner options

ParameterRequiredTypeDefaultDescription
permanentoptionalBooleanSet to true to always show the spinner (mostly used for demonstration purposes)
raisedoptionalBooleanSet to true to create a FAB-like appearance with shadow and whitespace around the spinner
shadowDepthoptionalNumber 0-51 (if raised is set)Depth of the shadow
showoptionalBooleanSet to true to show the spinner
sizeoptionalString"regular"Either "small" (24px), "regular" (32px), "medium" (40px), "large" (48px), "fab" (56px). Adds CSS class "small", "regular", "medium", "large", "fab"

Indeterminate options

For MaterialDesignSpinner and IOSSpinner:

ParameterRequiredTypeDefaultDescription
singleColoroptionalBooleanSet to true to use only one color (by default the primary color)

Determinate options

For MaterialDesignProgressSpinner:

ParameterRequiredTypeDefaultDescription
animatedoptionalBooleanfalseSet to true to animate the progress between subsequent steps
percentageoptionalNumber (0..1) or Function () -> Number(Determinate spinner) Sets the progress percentage value
updateDurationoptionalNumber (seconds)0.8The duration of the step progress update

Transition options

See: Transitions

Common component options

ParameterRequiredTypeDefaultDescription
afteroptionalString, hyperscript or componentExtra content after main content; note that this content is placed right of preceding elements with a higher stacking depth
beforeoptionalString, hyperscript or componentExtra content before main content; note that this content is placed left of subsequent elements with a lower stacking depth
classNameoptionalStringExtra CSS class appended to pe-spinner
elementoptionalString"div"HTML element tag
eventsoptionalObjectOptions object containing one or more standard events such as onclick (React: onClick)
idoptionalStringHTML element id
styleoptionalObjectFor setting simple style attributes
toneoptionalString: "dark" or "light"Renders the component light on dark (sets class pe-dark-tone); use "light" to locally inverse (sets class pe-light-tone)

Composition

Spinner sometimes uses:

  • Shadow (when raised is used)

CSS classes