--- layout: default title: Loading Animation Demo --- ← Back to Playground
Reusable loading spinner for async operations, page loads, and content fetching.
The original bouncing dots animation.
Show a loading overlay that covers the entire screen.
Display loading spinner inline within a container.
Different sizes for different contexts.
Wrap async functions with loading spinner.
// Show/hide existing spinner
LoadingSpinner.show('my-spinner');
LoadingSpinner.hide('my-spinner');
// Create dynamic spinner
const spinnerId = LoadingSpinner.create({
size: 'medium',
message: 'Loading...',
inline: false
});
// Remove when done
LoadingSpinner.remove(spinnerId);
// Wrap async operation
await LoadingSpinner.withSpinner(async () => {
const data = await fetchData();
return data;
}, { message: 'Fetching data...' });
{% raw %}{% include loading-spinner.html id="my-spinner" size="medium" message="Loading..." %}{% endraw %}