Loading overlay

A blurred cover with Inky and a rotating status line while a page fetches its data.

Loading…
Installation
$Terminal
npx shadcn@latest add https://sdk-components.thesqd.com/r/loading-overlay.json
Usage
Render it while the page fetches; flip `loading` to false when the data lands.
TSImport
import { LoadingOverlay } from "@/components/blocks/loading-overlay";
TSExample
import { LoadingOverlay } from "@/components/blocks/loading-overlay";

export function Page({ data }) {
  return (
    <>
      <LoadingOverlay
        loading={!data}
        states={["Fetching the project", "Gathering the files", "Almost there"]}
      />
      {data && <Content data={data} />}
    </>
  );
}
Composition
A blur over the page, Inky walking the full width, and the rotating status line under him.
LoadingOverlay            (role="status", fixed or `contained` blur, fades on `loading={false}`)
├── Inky                  (stageWidth "fill", scene, action "walkaway" — `inky` overrides)
├── ThinkingStates        (from ai-thinking-card — rotating shimmer line)
└── elapsed               (useElapsed from loading-state — `showElapsed`)
Default
The dynamic-forms prefetch blur over the page, with Inky walking the full width over the sea (`stageWidth="fill"`, `scene`, `action="walkaway"`) above the AI loader's rotating status line. Previews here are `contained`; on a real page it covers the viewport.
Loading…
Custom Inky and messages
`states` sets the messages. `emotion`, `action`, `thought`, `avatarSize` and `scene` are flat; `inky` takes any other Inky prop (skin, costume, person, vehicle, backdrop…) and wins over the flat ones.
Opening the viewer…0.0s
Contained, fading out
`contained` covers the nearest `relative` parent instead of the viewport. Set `loading={false}` when the data lands and the overlay fades away.
Loading…
API Reference
Props for the LoadingOverlay block.

LoadingOverlay

PropTypeDefaultDescription
loadingbooleantrueShow the overlay. `false` fades it out over 400ms.
containedbooleanfalseCover the nearest `relative` parent (absolute, z-10) instead of the viewport (fixed, z-100).
statesreadonly string[]a generic setStatus lines to rotate through.
stateDurationnumber2000How long each state holds before the next swaps in, ms.
emotionInkyEmotion—Inky's face. Unset, he is free — seasonal outfit and easter eggs.
actionInkyAction"walkaway"What Inky does while it waits.
thoughtstring—A thought bubble over Inky, with this text in it.
avatarSizenumber96Inky's frame side, px. Keep it a multiple of 32.
scenebooleantrueDraw the sea behind Inky.
inkyPartial<InkyProps>—Any other Inky prop — skin, costume, person, vehicle, backdrop, stageWidth. Spread last, so it wins.
textClassNamestringEmpty title sizeClasses for the status line — size, weight, colour.
showElapsedbooleanfalseShow a live elapsed timer under the line.
classNamestring—Merged onto the overlay. Any other div attribute passes through.