Updated
Loading Shimmer
Thinking…
Customize
Duration1.2s
Passes2
Text size48px
Installation
npx shadcn@latest add https://uibrik.com/r/loading-shimmer.jsonInstall the packages
npm install motionAdd the cn helper
Imports
cnfrom@/lib/utils, whichshadcn initcreates. Add it by hand without shadcn.Copy the source into your project
components/uibrik/loading-shimmer/loading-shimmer.tsx"use client"; import { cn } from "@/lib/utils"; import { motion } from "motion/react"; // `play` counts presses of a card's Change button. 0 means the card has not // been pressed yet, so every effect renders its resting state without // animating on page load. export type EffectProps = { play: number }; // Size comes from --text-effect-size (default 1.25rem, i.e. text-xl), so a // preview can enlarge every effect without changing the installed default. const SIZE = "text-[length:var(--text-effect-size,1.25rem)] leading-[1.4]"; const TEXT = `${SIZE} text-zinc-700 font-medium dark:text-zinc-200`; // 18 — A thinking indicator: a soft highlight passes across muted text, the // familiar signal that work is happening. Pressing Change runs two passes. export function LoadingShimmer({ play, text = "Thinking…", duration = 1.2, passes = 2, }: EffectProps & {
Adds the files to
components/uibrik/loading-shimmer and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/loading-shimmer.Usage
import { LoadingShimmer } from "@/components/uibrik/loading-shimmer/loading-shimmer";<LoadingShimmer play={0} text="Thinking…" duration={1.2} passes={2}/>Where to use Loading Shimmer
AI thinking states
A light sweep across "Thinking" text shows the model is working without a spinner.
Pairs with Streaming Chat
Status labels
Shimmering text works for "Saving" or "Syncing" messages in a toolbar.
Slow request placeholders
A sweep across placeholder text signals the content is coming.
Pairs with Skeleton
Props
LoadingShimmer- text
- Type string
- "Thinking…"
- The copy to animate.
- duration
- Type number
- 1.2
- Time for one pass of the highlight.
- passes
- Type number
- 2
- Passes per play.
- playrequired
- Type number
- –
- Each change plays the effect again; 0 shows its resting state.