About
A scrim with a spinner that covers a relatively-positioned container while it is busy, without shifting the layout underneath.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Loading Overlay to your project and fits it to your theme.
Code
How Loading Overlay is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import { LoadingOverlay } from "@/components/ui/loading-overlay";
import { useState } from "react";
export default function LoadingOverlayDemo() {
const [active, setActive] = useState(true);
return (
<div className="flex w-full h-full items-center justify-center bg-background p-6">
<div className="flex w-full max-w-sm flex-col items-center gap-4">
<div
aria-busy={active}
className="relative w-full rounded-[var(--radius-card)] border border-line bg-surface p-5 shadow-[var(--shadow-card)]"
>
<p className="text-[13px] font-bold text-ink">Exchange Money</p>
<div className="mt-4 flex flex-col gap-3">
<div className="flex items-center justify-between">
<span className="text-[12px] font-medium text-ink-soft">
From
</span>
<span className="text-[13px] font-bold text-ink">$ 500</span>
</div>
<div className="flex items-center justify-between">
<span className="text-[12px] font-medium text-ink-soft">
Currency rate
</span>
<span className="text-[13px] font-bold text-ink">
1 USD = 0,73 GBP
</span>
</div>
</div>
<LoadingOverlay
active={active}
label="Fetching the latest rate"
showLabel
blur
/>
</div>
<button
type="button"
onClick={() => setActive((prev) => !prev)}
className="inline-flex h-9 items-center justify-center rounded-full bg-accent px-4 text-[13px] font-semibold text-accent-ink transition-colors hover:bg-accent-strong"
>
{active ? "Finish loading" : "Start loading"}
</button>
</div>
</div>
);
}
















