guidelines

Loading States

Visual indicators that let the user know there is something happening in the background and that they should wait a moment for it to finish.

Loading states are very important because they let a user know that nothing is wrong and that something is happening. Imagine uploading an image/file or accessing a very data heavy page with no visual feedback that anything is happening. That visual feedback will keep users from becoming confused and may even keep them from leaving.

Types of loading states

1. Progress Bars

If the user takes an action where progress can be tracked, the obvious choice is to use a progress bar. File uploads are a good example of when to use progress bars. We already know the file size and can easily show the user how much of the total size has been uploaded. When using progress bars, try not to just show the bar itself. Pair it with text, such as a label describing what the progress bar is for, as well as a numerical representation of the progress (whether it be in units such as bytes/kilobytes/etc or percentages).

2. Spinners

If the user takes an action where progress can't be tracked, spinners can be used. That small amount of visual feedback is often enough to keep users engaged and aware of what is happening. You should often add text to go along with your spinners to prompt the user to wait a moment or tell them what to do if the action is taking too long.

3. Skeleton/Ghost States

Skeleton or ghost states are typically used when a page is in the process of loading. They provide a “wireframe” view of what the user will see once the page is fully loaded. This is particularly good in the case that elements of the page load in at different times. The skeleton loader will keep the page from jumping around as it loads. It is a good idea to use skeleton states even if the page does not take a long time to load. This will greatly benefit your users who are on slower connections.

Things to consider...

  • Indicate completion of a loading event. For example, if a user makes an action that takes a moment, you could show a spinner and instead of just disappearing on completion, it could turn into a green check mark for one to three seconds before doing so.
  • Notify users about load times for loading events will take a while, but it is not possible to give a time estimate. Even just saying "this may take a while" is better than letting the user wonder if the action they attempted has failed.
  • Give users an "out" if a loading event will take a long time. This is a best practice that should not be overlooked, regardless of the type of loading state being utilized. Providing the user with a cancel button or any specific instructions that may be necessary (depending on your use case) is a very good idea.
  • Allow users to try again if an attempted action fails or if the action can yeild different results with different parameters.