Ticker
nocdn-ui/tickerFreeComponent
A status ticker that animates nicely when it's text is changed.
Live preview
live · rendered by the registry
Rendered by nocdn/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.bartoszbak.org/r/ticker.jsonSource
1"use client"23import { AnimatePresence, motion } from "motion/react"4import { useEffect, useState } from "react"56export function Ticker({ text }: { text: string }) {7 const [currentText, setCurrentText] = useState<string>(text)89 useEffect(() => {10 setCurrentText(text)11 }, [text])1213 return (14 <motion.div15 initial={{ opacity: 0, y: -10, filter: "blur(1px)" }}16 animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}17 exit={{ opacity: 0, y: -10, filter: "blur(1px)" }}18 className="font-jetbrains-mono mt-1 mb-3 flex items-center text-sm font-medium text-gray-500"19 >20 <AnimatePresence mode="wait">21 <motion.span22 key={currentText}23 initial={{ opacity: 0, filter: "blur(1px)", y: -3 }}24 animate={{ opacity: 1, filter: "blur(0px)", y: 0 }}25 exit={{ opacity: 0, filter: "blur(1px)", y: 3 }}26 transition={{ duration: 0.15, ease: "easeInOut" }}27 className="ml-1.5 text-black dark:text-gray-200"28 >29 {currentText}30 </motion.span>31 </AnimatePresence>32 </motion.div>33 )34}
What it pulls in
npm packages
Files it writes
More from nocdn/ui
All 3 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Buttonanimated-button | nocdn/ui | Components | Free | 1 dep | |
| Cornered Buttoncornered-button | nocdn/ui | Components | Free | no deps |
