Fullscreen Loading Overlay
Fullscreen tailwind loading screen with backdrop blur and a centered spinner.
Loading, please wait...
<div class="relative w-full h-64 rounded-2xl overflow-hidden bg-slate-200">
<div class="absolute inset-0 flex flex-col items-center justify-center gap-4 bg-slate-900/60 backdrop-blur-sm">
<div class="w-12 h-12 rounded-full border-4 border-white/25 border-t-white animate-spin"></div>
<p class="text-white text-sm font-medium">Loading, please wait...</p>
</div>
</div>Free to use in personal and commercial projects. No attribution required.
Variants
Same component, different looks. Preview each one live and copy the code you like.
Light
Bright overlay for light themed apps where a dark veil would jar.
Loading, please wait...
Brand
Indigo spinner that keeps brand color visible during waits.
Saving your work…
Minimal
Spinner only, no text, for short waits under a couple of seconds.
About this fullscreen loading overlay
A tailwind loading screen is the fullscreen veil sites show while data fetches, files upload, or routes transition: it blocks interaction and tells the user something is happening. The fullscreen loader overlay pattern prevents rage-clicks during slow requests, which is why dashboards, checkout flows, and onboarding wizards all rely on it.
This page loading overlay css uses an absolutely positioned layer with a dark translucent background and backdrop-blur-sm, so the page behind is visible but clearly inactive. The loading backdrop spinner is a bordered circle with only the top border opaque, spun by Tailwind's built-in animate-spin. A short status line under the spinner sets expectations, and flex centering keeps everything composed at any viewport size.
In production, render this as a fixed inset-0 z-50 layer toggled by your loading state. Keep it for operations that genuinely take over a second; for quick fetches, a skeleton or inline spinner feels faster. Always include a timeout or error path so a failed request never leaves the user staring at a spinner forever.
Slow requests create a dangerous moment: the page looks ready but is not. Visitors click again, submitting twice, or navigate away mid-request and corrupt the flow. The fullscreen overlay removes the temptation entirely by removing the targets. It also solves the subtler problem of half-loaded controls, where users act on stale interface state and blame the product for the resulting mess.
The veil is a fixed inset-0 layer with a high z-index, so it covers the viewport no matter how far the visitor scrolled. A translucent dark background with backdrop-blur-sm keeps the page recognizable but clearly inactive. The spinner itself is a bordered circle with only the top border opaque, spun by animate-spin; that single opaque arc is what makes rotation visible with zero extra elements. A short status line under the spinner sets expectations.
Give long operations a cancel button once they pass five seconds; a spinner with no exit is a hostage situation. Enforce a minimum display time of 400ms so quick operations don't flash the veil for a single frame, which reads as a glitch. For multi-step operations, show step labels like Uploading, Processing, Done; a single endless spinner hides whether progress is real. When the operation finishes, keep the overlay 200ms longer and fade it; instant removal can reveal a half-painted page.
An overlay with no timeout is a bricked page waiting to happen. When a request hangs, perhaps a stalled upload or a dead API, the visitor stares at a spinner with no exit and no information. Always race the operation against a timeout that swaps the overlay to an error state with a retry button. The veil must have an escape hatch, or it turns a slow request into a lost customer.
Where to use it
- ✓ Data fetching on dashboards
- ✓ Checkout and payment processing
- ✓ File uploads
- ✓ Route transitions in SPAs
Customization tips
Deepen the veil with bg-slate-900/70 or lighten it for a softer feel. Swap the ring spinner for your brand loader, and change the status text per operation ('Uploading...', 'Processing payment...'). Add a subtle fade by transitioning opacity when the overlay mounts and unmounts.
Design notes
When to use
A fullscreen loading overlay fits moments when interaction genuinely must pause: file uploads, payment processing, and full route transitions where half-loaded controls would be dangerous. The backdrop blur and centered spinner tell the visitor something is happening and that waiting is the right move. Use it when the alternative is a broken intermediate state.
What to avoid
Do not cover the whole screen for a partial load, like refreshing one sidebar widget, because freezing the entire app for a small job feels broken. Avoid long operations with no progress or cancel option, since a veil with no exit breeds panic. And do not show the overlay for flashes under half a second, where it only adds flicker.
Accessibility
Announce what is happening with text like Uploading your file, and use aria-busy or a dialog role so assistive technology knows the page is busy. For operations longer than a few seconds, provide a cancel control that is keyboard reachable.
Frequently asked questions
How do I create a tailwind loading screen overlay?
Use a fixed inset-0 container with a high z-index, a translucent dark background, and a centered spinner. Toggle its visibility with your loading state: show it when the request starts, hide it in both the success and error handlers.
Should the overlay block all interaction?
Yes, that is its job. The backdrop should cover the full viewport and sit above all content so clicks cannot reach controls underneath. Make sure keyboard focus is also trapped or moved, so tab users cannot wander behind the veil.
Spinner or progress bar for long operations?
A spinner suits indeterminate waits under ten seconds. For uploads or multi-step jobs where you know the percentage, a progress bar with a real number feels more honest and reduces abandonment.
How do I hide a loading overlay when the page finishes loading?
Listen for the window load event, then add an opacity-0 class and remove the element from the DOM after the transition ends. Never rely on a fixed setTimeout alone, since slow networks will hide the overlay before content is ready. For app-style loading, hide it when your data fetch resolves instead.
What z-index should a loading overlay use?
Above everything interactive on the page, since its job is to cover the full viewport. Tailwind's z-50 is usually enough unless your modals or drawers sit higher, in which case use an arbitrary value like z-[9999]. Nothing should intentionally render above a loading overlay.
Should a loading overlay blur the page behind it?
For app-like loading states, backdrop-blur-sm over a semi-transparent layer looks polished and signals the page is still there. For initial page boot, a solid background color is better because there is no painted content to blur yet. Match the overlay background to your theme so dark-mode users do not get flashed with white.