JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 26
  • Score
    100M100P100Q10470F
  • License Apache-2.0

A React component that displays a spinning icon to show a loading state

Package Exports

  • ak-spinner

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ak-spinner) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

AtlasKit component registry Commitizen friendly semantic-release Report an issue Ask in our forum

Spinner

Spinners are used for showing a system process of unknown length going on that ends with the system displaying results to the user.

Example spinner

Try it out

Interact with a live demo of the ak-spinner component.

Installation

npm install ak-spinner

Using the component

Import the component in your React app as follows:

import Spinner from 'ak-spinner';
ReactDOM.render(<Spinner />, container);

The spinner will display a loading in animation and then continue spinning until the isCompleting prop is set on it.

If this prop is set to true the spinner will begin playing the outro animation (approximately 300ms).

You can be notified once the animation is complete by hooking into the onComplete callback like so.

import Spinner from 'ak-spinner';

// some flag that we will set once our long running task is complete
let loadingFinishedFlag = false;

function loadingFinished() {
  // show our loaded content, etc
}

// this would normally be in a component or an app
ReactDOM.render(<Spinner
  isCompleting={loadingFinishedFlag}
  onComplete={loadingFinished}
/>);

The result is a very smooth loading in and out animation that should feel seamless to the user.

Support and feedback

We're here to help!

Let us know what you think of our components and docs, your feedback is really important for us.

Community support

Ask a question in our forum.

Check if someone has already asked the same question before.

Create a support ticket

Are you in trouble? Let us know!