ThinkingLoader
LLM-style "labor illusion" loader with blur conveyor animations and shimmer text effect.
Supports both controlled mode (parent drives currentStep) and uncontrolled mode
(auto-cycles through steps based on interval).
Usage
import { ShimmerVariant, STEP_TIMING, ThinkingLoader, ThinkingLoaderCounter, ThinkingLoaderIcon, ThinkingLoaderOrb, ThinkingLoaderProps, ThinkingLoaderStep, ThinkingStep, useThinkingLoader } from "@desk/ui/components/thinking-loader";Best practices
Drive
ThinkingLoaderwithcurrentStep(controlled) to reflect real progress, or omit it to auto-cyclestepsonintervalfor a labor-illusion loader.It already renders an
aria-live="polite"region announcing each step — don't wrap it in another status role. MountReducedMotionProvidersince it animates viam.*.
Props
ThinkingLoader
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | Additional CSS classes | |
| currentStep | number | Controlled mode: parent drives step progression | |
| interval | number | Total cycle time per step in ms, used for uncontrolled auto-cycling (default: 2500) | |
| loader | ReactNode | Custom static loader visual rendered on the left of the shimmer text.
When provided, replaces the per-step morphing icon (and overrides
| |
| orb | ThinkingLoaderOrb | Inline {@link ThinkingOrb } in the loader slot. Ignored when | |
| morphIcons | boolean | Icons morph in place instead of animating with text (default: false) | |
| onStepChange | (index: number, step: ThinkingStep) => void | Callback when step changes (uncontrolled mode) | |
| shimmer | boolean | Enable shimmer effect (default: true) | |
| shimmerVariant | ShimmerVariant | Shimmer highlight direction. Defaults to | |
| showCounter | boolean | Show "1/4" counter | |
| steps | ThinkingStep[] | Array of steps to display |
ThinkingLoaderCounter
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | ||
| current | number | ||
| total | number |
ThinkingLoaderIcon
| Prop | Type | Default | Description |
|---|---|---|---|
| icon | LucideIcon | undefined | ||
| stepId | string |
ThinkingLoaderStep
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | ||
| hideIcon | boolean | Hide icon (when rendered separately for morphing) | |
| inheritSize | boolean | Skip the standalone | |
| shimmer | boolean | ||
| shimmerVariant | ShimmerVariant | Shimmer highlight direction. Defaults to | |
| step | ThinkingStep |
Also exports
- type
ShimmerVariant - const
STEP_TIMING - type
ThinkingLoaderOrb - interface
ThinkingLoaderProps - interface
ThinkingStep - const
useThinkingLoader
Composition
Builds on