Inline loading
General guidance
Inline loading spinners are used when performing actions. They help notify user’s that their action is being processed. The waiting experience is a crucial design opportunity. Although it may not be obvious what is occurring on the back-end, we can communicate clearly to reassure the user that progress is happening.
It is best practice to use an Inline loading component for any Create, Update, or Delete actions. The component provides feedback to the user about the progress of the action they took. This could be in a table, after a primary or secondary button click, or even in a modal.
Format
If the inline loading is being used to submit a form, the form fields should get disabled.
Descriptive text for the action is optional, but encouraged. If you have limited room or find adding text to be unnecessary you can just run through the animations.
The success state of the inline loading component is active for 1.5 seconds before calling a optional function onSuccess. Use the onSuccess function to refetch new data, close a modal, or reset a form. If no function is specified the success state will last indefinitely.
If an error occurs, the Inline loading component should be hidden and a error notification should be added or error handling within a form should appear.
The inline loading component should never be used to load a page or data.
States
Loading
The loading state indicates that the action is still in progress.
![Example of inline loading Example of inline loading](/static/7fff4928e32bb443ecc3d43bf3642626/c801a/inline-loading-usage-1.png)
Success
The success state indicates that the action completed successfully.
![Example of loading success Example of loading success](/static/82effd1b5dbd0b9cf528e9bb1da27ab6/c801a/inline-loading-usage-2.png)
Error
The error state indicates that the action did not complete successfully.
![Example of loading error Example of loading error](/static/c60ee196e2b8aafd5d2c025acea95d6d/c801a/inline-loading-usage-3.png)