Loader
Loading indicators: loading-dev's Blocks and dots, and thinking-orbs' ThinkingOrb.
Loader is for every pending state in the interface; ThinkingDots and TypingDots are for a conversation; ThinkingOrb is for an agent's wait of two seconds or more, with a state that says what it is doing. All of them stand still when the person prefers reduced motion.
Sizes and sweeps
Importing 214 rows
import { Loader } from "@/components/ui/loader"
export default function LoaderSizesAndSweeps() {
return (
<div className="flex flex-col items-center gap-6">
<div className="flex items-center gap-6">
<Loader size={12} />
<Loader />
<Loader size={24} />
<Loader size={24} sweep="rows" />
<Loader size={24} sweep="columns" />
</div>
<div role="status" className="flex items-center gap-2 text-muted-foreground">
<Loader />
Importing 214 rows
</div>
</div>
)
}
Dots
Reading the release notes
Support is typing
import { ThinkingDots, TypingDots } from "@/components/ui/loader"
export default function LoaderDots() {
return (
<div className="flex flex-col gap-4">
<div role="status" className="flex items-center gap-2 text-muted-foreground">
<ThinkingDots size={16} />
Reading the release notes
</div>
<div role="status" className="flex items-center gap-2 text-muted-foreground">
<TypingDots size={16} />
Support is typing
</div>
</div>
)
}
Thinking orb
workingsearchingsolvinglisteningconnectingweavingcomposingbreathingshaping
import { ThinkingOrb, type OrbState } from "@/components/ui/loader"
const states: OrbState[] = [
"working",
"searching",
"solving",
"listening",
"connecting",
"weaving",
"composing",
"breathing",
"shaping",
]
export default function LoaderThinkingOrb() {
return (
<ul className="grid grid-cols-3 gap-x-8 gap-y-6">
{states.map((state) => (
<li key={state} className="flex flex-col items-center gap-2">
<ThinkingOrb state={state} />
<code className="text-xs text-muted-foreground">{state}</code>
</li>
))}
</ul>
)
}
Thinking orb sizes
Searching 3 projects
import { ThinkingOrb } from "@/components/ui/loader"
export default function LoaderThinkingOrbSizes() {
return (
<div className="flex flex-col items-center gap-6">
<div className="flex items-center gap-6">
<ThinkingOrb size={20} />
<ThinkingOrb size={32} />
<ThinkingOrb size={64} />
<ThinkingOrb size={64} paused aria-label="Paused" />
</div>
<div role="status" className="flex items-center gap-2 text-muted-foreground">
<ThinkingOrb state="searching" size={20} aria-hidden />
Searching 3 projects
</div>
</div>
)
}
Installation
npx shadcn@latest add @khaeli/loaderbunx --bun shadcn@latest add @khaeli/loaderInstall @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.
Installs with
- npm packages
- loading-dev ^0.3.3
- thinking-orbs ^0.3.2
Accessible name
Loader,ThinkingDotsandTypingDotsare hidden from assistive technology (aria-hidden) and cannot be named. Always put them beside text that says what is happening, in arole="status"element when it appears while the page is in use.ThinkingOrbis an image (role="img") named after its state: Working…, Searching… and so on. Passaria-labelto say more, oraria-hiddenwhen text beside it already does.
Registry JSON
The item as the shadcn CLI reads it, with every file it ships: https://ui.khaeli.com/r/loader.json