AI Text Loading
kokonut-ui/ai-text-loadingFreeComponent
Thinking mode.
Live preview
live · rendered by the registry
Rendered by kokonut-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://kokonutui.com/r/ai-text-loading.jsonSource
1"use client";23/**4 * @author: @kokonutui5 * @description: AI Text Loading6 * @version: 1.0.07 * @date: 2025-06-268 * @license: MIT9 * @website: https://kokonutui.com10 * @github: https://github.com/kokonut-labs/kokonutui11 */1213import { AnimatePresence, motion } from "motion/react";14import { useEffect, useState } from "react";15import { cn } from "@/lib/utils";1617interface AITextLoadingProps {18 texts?: string[];19 className?: string;20 interval?: number;21}2223export default function AITextLoading({24 texts = [25 "Thinking...",26 "Processing...",27 "Analyzing...",28 "Computing...",29 "Almost...",30 ],31 className,32 interval = 1500,33}: AITextLoadingProps) {34 const [currentTextIndex, setCurrentTextIndex] = useState(0);3536 useEffect(() => {37 const timer = setInterval(() => {38 setCurrentTextIndex((prevIndex) => (prevIndex + 1) % texts.length);39 }, interval);4041 return () => clearInterval(timer);42 }, [interval, texts.length]);4344 return (45 <div className="flex items-center justify-center p-8">46 <motion.div47 animate={{ opacity: 1 }}48 className="relative w-full px-4 py-2"49 initial={{ opacity: 0 }}50 transition={{ duration: 0.4 }}51 >52 <AnimatePresence mode="wait">53 <motion.div54 animate={{55 opacity: 1,56 y: 0,57 backgroundPosition: ["200% center", "-200% center"],58 }}59 className={cn(60 "flex min-w-max justify-center whitespace-nowrap bg-[length:200%_100%] bg-gradient-to-r from-neutral-950 via-neutral-400 to-neutral-950 bg-clip-text font-bold text-3xl text-transparent dark:from-white dark:via-neutral-600 dark:to-white",61 className62 )}63 exit={{ opacity: 0, y: -20 }}64 initial={{ opacity: 0, y: 20 }}65 key={currentTextIndex}66 transition={{67 opacity: { duration: 0.3 },68 y: { duration: 0.3 },69 backgroundPosition: {70 duration: 2.5,71 ease: "linear",72 repeat: Number.POSITIVE_INFINITY,73 },74 }}75 >76 {texts[currentTextIndex]}77 </motion.div>78 </AnimatePresence>79 </motion.div>80 </div>81 );82}
What it pulls in
npm packages
Files it writes
More from kokonut-ui
All 40 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Action Search Baraction-search-bar | kokonut-ui | Components | Free | 2 deps · 2 files | |
| AI Input Searchai-input-search | kokonut-ui | Components | Free | 1 dep · 2 files | |
| AI State Loadingai-loading | kokonut-ui | Components | Free | 1 dep | |
| AI Input Selectorai-prompt | kokonut-ui | Components | Free | 2 deps · 4 files | |
| AI Voiceai-voice | kokonut-ui | Components | Free | 2 deps | |
| Apple Activity Cardapple-activity-card | kokonut-ui | Components | Free | 1 dep | |
| Magnet Buttonattract-button | kokonut-ui | Components | Free | 2 deps | |
| Avatar Pickeravatar-picker | kokonut-ui | Components | Free | 2 deps |
