Getting Started
Components
- Agent Status
- Agent Template Card
- API Key Card
- Button
- Channel Status Card
- Chat Composer
- Code Editor
- Condition Builder
- Confirm Dialog
- Conversation
- Dataset Card
- Document Status Badge
- Extraction Strategy Select
- File Icon
- File Upload
- Indexing Progress
- Matrix
- Message
- Model Diff View
- Model Selector
- Model Type Filter
- Node Catalog
- Option Editor
- Output Variables View
- Package Card
- Prompt Editor
- Provider Status Card
- Radio Card
- Resource Card
- Resource Sidebar
- Response
- Run Node List
- Segment Card
- Shimmering Text
- Token Trend Chart
- Tool Call Card
- Usage Stat Card
- Variable Binding Editor
- Variable Selector
- Workflow Node Card
- Workspace Selector
ZGI Status Text
Animated status text for agent and workflow states
ZGI agent is thinking...
"use client"
import { useEffect, useState } from "react"
import { AnimatePresence, motion } from "motion/react"
import { ShimmeringText } from "@/components/ui/shimmering-text"
const phrases = [
"ZGI agent is thinking...",
"Structuring the workflow...",
"Reviewing product context...",
"Drafting the response...",
"Preparing the handoff...",
]
export function TextShimmerDemo() {
const [currentIndex, setCurrentIndex] = useState(0)
useEffect(() => {
const interval = setInterval(() => {
setCurrentIndex((prev) => (prev + 1) % phrases.length)
}, 3000)
return () => clearInterval(interval)
}, [])
return (
<div className="bg-card w-full rounded-lg border p-6">
<div className="mb-4">
<h3 className="text-lg font-semibold">ZGI Status Text</h3>
<p className="text-muted-foreground text-sm">
Animated status text for agent and workflow states
</p>
</div>
<div className="space-y-4">
<div className="bg-muted/10 flex items-center justify-center rounded-lg py-8">
<AnimatePresence mode="wait">
<motion.div
key={currentIndex}
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -10 }}
transition={{ duration: 0.3 }}
>
<ShimmeringText text={phrases[currentIndex]} />
</motion.div>
</AnimatePresence>
</div>
</div>
</div>
)
}
Installation
pnpm dlx shadcn@latest add https://ui.zgi.ai/r/shimmering-text.json
Usage
import { ShimmeringText } from "@/components/ui/shimmering-text"Basic Usage
<ShimmeringText text="Hello, World!" />Custom Duration and Colors
<ShimmeringText
text="Custom Shimmer"
duration={3}
color="#6B7280"
shimmerColor="#3B82F6"
/>Trigger on Viewport Entry
<ShimmeringText
text="Appears when scrolled into view"
startOnView={true}
once={true}
/>Repeating Animation
<ShimmeringText
text="Repeating Shimmer"
repeat={true}
repeatDelay={1}
duration={2}
/>With Custom Styling
<ShimmeringText
text="Large Heading"
className="text-4xl font-bold"
spread={3}
/>API Reference
ShimmeringText
An animated text component with gradient shimmer effect and viewport detection.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| text | string | - | Required. Text to display with shimmer effect |
| duration | number | 2 | Animation duration in seconds |
| delay | number | 0 | Delay before starting animation |
| repeat | boolean | true | Whether to repeat the animation |
| repeatDelay | number | 0.5 | Pause duration between repeats in seconds |
| className | string | - | Optional CSS classes |
| startOnView | boolean | true | Whether to start animation when entering viewport |
| once | boolean | false | Whether to animate only once |
| inViewMargin | string | - | Margin for viewport detection (e.g., "0px 0px -10%") |
| spread | number | 2 | Shimmer spread multiplier |
| color | string | - | Base text color (CSS custom property) |
| shimmerColor | string | - | Shimmer gradient color (CSS custom property) |
Notes
- Built with Motion for smooth, performant animations
- Uses CSS gradient background animation for the shimmer effect
- Viewport detection powered by Motion's
useInViewhook - Dynamic spread calculation based on text length for consistent appearance
- Supports custom colors via CSS custom properties
- Text uses
background-clip: textfor gradient effect - Default colors adapt to light/dark mode automatically
- Optimized with
useMemofor performance - Animation can be controlled via viewport intersection or immediate start
Deploy and Scale Agents with ZGI
ZGI delivers the infrastructure and developer experience you need to ship reliable agent, workflow, and knowledge applications at scale.
Talk to an expert